Passing an optimization flag to a Go compiler?

Actually no explicit flags, this Go wiki page lists optimizations done by the Go compiler and there was a discussion around this topic in golang-nuts groups.

You can turn off optimization and inlining in Go gc compilers for debugging.

-gcflags '-N -l'
  • -N : Disable optimizations
  • -l : Disable inlining

Leave a Comment