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.
The dead code elimination (DCE) is defeated by the usage of
copier.Copyinsideutil.CopyDNSClient.copier.Copyusesreflect.Value.MethodByName:https://github.com/jinzhu/copier/blob/c6b47b092d9840406d0abc347e68a28a7b812643/copier.go#L396-L401
I think I understand why the
dns.Clientis 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.