Skip to content

copier.Copy inside util.CopyDNSClient defeat the DCE #152

@ldez

Description

@ldez

The dead code elimination (DCE) is defeated by the usage of copier.Copy inside util.CopyDNSClient.

copier.Copy uses reflect.Value.MethodByName:

https://github.com/jinzhu/copier/blob/c6b47b092d9840406d0abc347e68a28a7b812643/copier.go#L396-L401

I think I understand why the dns.Client is copied, but this is not always useful.

The defeat of the DCE has a huge impact on binary size.

I can think to several way to fix the problem, but I want your feedback before making proposals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions