Can you elaborate ? Which compiler flag is needed for compilation ?
For Go modules if you don't have 'GO111MODULE' set to 'auto' or something appropriate, your code will whine about not being a module or something ridiculous. It will also cry about pulling in Go code with 'go get' if you don't have that environment variable properly configured.
If you don't set anything, and you are inside GOPATH, module mode is disabled. If you are outside GOPATH, module mode is enabled.
I think that is the most sane behavior. And this flag is needed because modules are an experimental feature.
How else do you recommend to release experimental features ?