Reflection in general isn't the problem, but if you specifically use reflection to look up a method in your program, then dead code elimination gives up. https://go.dev/src/cmd/link/internal/ld/deadcode.go
Taught to me on HN recently: https://news.ycombinator.com/item?id=30041763