I'm trying to import from Jenkins-X/jx to customize some stuff a little bit.
I'm really new to go heads up
but trying to go get ./...
fails.
my go.mod file
module github.com/my-org/my-project
go 1.13
require github.com/jenkins-x/jx v2.0.383
I get
... require github.com/jenkins-x/jx: version "v2.0.383" invalid: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2
which is because jx has a few requirements in its mod file
But I'm not sure what I have to do to actually download the module.
If an error occurs, the result will be a Module struct with a non-nil Error field. The go mod download command downloads the named modules into the module cache. Arguments can be module paths or module patterns selecting dependencies of the main module or version queries of the form path@version.
This error happens when you attempt to fetch a module that has a major version equal or higher than v2, but either their own go.mod file, or your import path are missing the necessary /vN suffix. If the module is version v2 or higher, the major version of the module must be included as a /vN at the end of the module paths used in go.mod files
Each Go module is defined by a go.mod file that describes the module’s properties, including its dependencies on other modules and on versions of Go. These properties include:
To preserve import compatibility, the go command requires that modules with major version v2 or later use a module path with that major version as the final element. For example, version v2.0.0 of example.com/m must instead use module path example.com/m/v2.
To anyone looking to compile with some neat Jenkins-x functions I was able to talk to the creators and found out a few things.
1.12.4
go.mod
and uses jenkins-x/jx as a requirement0.0.0-timestamp-commithash
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With