How does one uses environment variables to optimize a go binary?
For instance, with C and GCC, you would set CFLAGS="-O2 -march=znver1 to build with tier 2 optimizations, with specific optimizations for the Zen microarchitecture.
I couldn't find an equivalent environment variable in Golang's documentation.
Go does provide a way to disable them all, but not to specify which one to use in case you are using gccgo as the compiler back-end. It is thus very different from other questions asked about optimizations flags for Go in general (Passing an optimization flag to a Go compiler? for instance)