On Wed, Jun 21, 2017 at 2:44 PM <sorainno...@gmail.com> wrote: > I read somewhere that Go will remove unused functions so that it wont be included into binaries when it can prove no code is using it.
Correct. > However I am using reflection to call functions that are inside the binaries without first having any variable using it. How do you use reflection to call a function that's not referenced anywhere? > Is there compiler option to include every functions in source code into binary so that it will be used at runtime upon request? AFAIK no. > PS : Please don't suggest to call those unused functions and discard the output just to make it compiles into binary No option bellow calls f. var _ = f or var _ = f != nil or var foo = f -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.