golang: Go modules support; Prepare to deprecate GOPATH
Add support for using Go modules to golang/gowork infrastructure:
-
Users can now request to install a module via gowork:install as. e.g. in the following example:
[gowork] install = lab.nexedi.com/kirr/neo/go/...@v0.0.0-20210103165133-f3effa6c535f golang.org/x/tools/gopls@v0.4.3 ${helloweb:location}/go:./...
The first two request to install programs from an external module at particular revision/version. The latter requests to install programs from locally cloned/checked-out module source.
The documentation now talks only about programs, because "package installation" became unnecessary long time ago as Go toolchain uses right packages and recompiles things as needed automatically since introduction of the Go build cache in go 1.10.
-
The change comes accompanied by corresponding helloweb change that reworks it to a) become a module itself, and b) to use other modules - that are not explicitly cloned by buildout - so that we can be sure that module way of fetching/building things actually works.
-
Non-module way - e.g. build via GOPATH - is still supported (because e.g. software/gitlab still uses it), but not explicitly documented and scheduled to be deprecated and removed. The reason for this is that upstream Go is going to remove support for GOPATH and leave only module-based approach in Go1.17
https://github.com/golang/go/issues/37755#issuecomment-771879911
/cc @jerome, @luke, @tomo, @alain.takoudjou