Go changed the way GO111MODULES is interpreted in 1.17+ and therefore xgo needs to recognise this change of behaviour.
Now, we could use the GO_VERSION environment variable but it's not really well defined as the build.sh script has apparently different interpretations within it. Thus this PR actually drops to parsing the result of go version to get the MAJOR and the MINOR version number out. The tests that use GO_VERSION are then changed to heed the results of these and the GO111MODULES behaviour is changed to match that.
Finally there were a number of issues detected with shellcheck in the scripts and this PR fixes the lint for these too.
(This PR could be split in two if necessary to helpfully separate the linting issues from the other fixes.)
Go changed the way GO111MODULES is interpreted in 1.17+ and therefore xgo needs to recognise this change of behaviour.
Now, we could use the GO_VERSION environment variable but it's not really well defined as the build.sh script has apparently different interpretations within it. Thus this PR actually drops to parsing the result of
go version
to get the MAJOR and the MINOR version number out. The tests that use GO_VERSION are then changed to heed the results of these and the GO111MODULES behaviour is changed to match that.Finally there were a number of issues detected with shellcheck in the scripts and this PR fixes the lint for these too.
(This PR could be split in two if necessary to helpfully separate the linting issues from the other fixes.)
Fix #179