You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2025. It is now read-only.
Remove the dependency on github.com/modern-go/reflect2 #691
reflect2 is too brittle because of the reliance on the internals of the golang's compiler. Moreover, it is no longer maintained: github.com/modern-go/reflect2..
Replace the usages of github.com/modern-go/reflect2 with stdlib's reflect.
Reacted by wenqian, Egon Elbre, Gyllsdorff and Pierre Gimalac
Also for the record reflect2 wraps reflect.Type under the hood, which means when using it the linker considers the Method and MethodByName functions as reachable (even if this library doesn't use them), which disables some dead code elimination, resulting in a significantly bigger binary... (see this talk for more details)
Having this optimization enabled reduced a binary I work on from around 36MB to 29MB.
Activity
fioncat commentedon Mar 18, 2024
Agreed, after i updated go to 1.20,
reflect2panic directly, this is awful.pgimalac commentedon Dec 21, 2024
Also for the record
reflect2wrapsreflect.Typeunder the hood, which means when using it the linker considers theMethodandMethodByNamefunctions as reachable (even if this library doesn't use them), which disables some dead code elimination, resulting in a significantly bigger binary... (see this talk for more details)Having this optimization enabled reduced a binary I work on from around 36MB to 29MB.