The go mod download subcommand can raise errors on certain modules where the module path does not match the module version.
Notably, the go mod vendor subcommand does not error on the same repository version and dependency set. TBD if there is an upstream issue filed for this behavior. obs-service-go_modules calling of commands via the subprocess module must handle this behavior while occurrence remains a possibility.
k3s $ git checkout v1.23.6+k3s1
k3s $ go mod download
go: github.com/k3s-io/etcd@v3.4.18-k3s1+incompatible: invalid version: module contains a go.mod file, so module path must match major version ("github.com/k3s-io/etcd/v3")
In the above case, go mod download has return code 1, stdout is empty and the error message is written to stderr.
The
go mod download
subcommand can raise errors on certain modules where the module path does not match the module version. Notably, thego mod vendor
subcommand does not error on the same repository version and dependency set. TBD if there is an upstream issue filed for this behavior.obs-service-go_modules
calling of commands via thesubprocess
module must handle this behavior while occurrence remains a possibility.In the above case,
go mod download
has return code1
,stdout
is empty and the error message is written tostderr
.