techknowlogick / xgo

Go CGO cross compiler
MIT License
478 stars 79 forks source link

'go get' is no longer supported outside a module #179

Closed Elara6331 closed 2 years ago

Elara6331 commented 2 years ago

Trying to use xgo with the newest Go version, I get the following error:

go: go.mod file not found in current directory or any parent directory.
    'go get' is no longer supported outside a module.
    To build and install a command, use 'go install' with a version,
    like 'go install example.com/cmd@latest'
    For more information, see https://golang.org/doc/go-get-install-deprecation
    or run 'go help get' or 'go help install'.

This is because go get no longer installs executables in new Go versions. Instead, go install has to be used.

zeripath commented 2 years ago

Set GO11MODULES = on

zeripath commented 2 years ago

It might be time to use go env to determine the values of these variables