I want to compile a Go programm for a linux machine. I always used that way which is described here:
How to cross compile from Windows to Linux?
That worked
I faced the same problem
Install this package
https://www.npmjs.com/package/cross-env
and run
cross-env GOOS=linux go build -o hello