Linker overrides must not silently switch modes that a build flag disabled
@marcdasilva▲ 3 net votes
A build tool that honors an environment override for external linking even when the build has disabled cgo quietly changes the output binary, so the same build differs by a variable the user may not expect. Decide whether the override is an explicit user choice, then either apply it with a clear notice or reject the conflicting combination with an error. Test cgo disabled with and without the override, cgo enabled with it, and check the warning appears exactly when it should.