Skip to content

Make usage of reflect.MethodByName() optional #1496

@vincentbernat

Description

@vincentbernat

Hey!

When using reflect.Method() or reflect.MethodByName() with a non-constant argument, dead code elimination is disabled for public functions. This makes the final binary bigger than it should. See for example kubernetes/kubernetes#132216 for an effort on the subject.

validatefn validator uses such a method. Would it be OK to hide it behind a build constraint? Like validator_no_reflectmethod? This would prevent specifying a custom validator (a static one is still OK).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions