gitlab-cli
gitlab-cli copied to clipboard
Add major version to import path
This allows grabbing the latest release with go get and go modules enabled. For this, the import path within the Go files needed to be changed in order to reflect the major version.
Before this change:
$> go get github.com/makkes/gitlab-cli/cmd/gitlab
go: downloading github.com/makkes/gitlab-cli v1.0.0
go get github.com/makkes/gitlab-cli/cmd/gitlab: module github.com/makkes/gitlab-cli@upgrade found (v1.0.0), but does not contain package github.com/makkes/gitlab-cli/cmd/gitlab
As you can see, it tries to grab v1.0.0, as the import path does not contain a major version. When specifying the (correct) target version:
$> go get github.com/makkes/gitlab-cli/cmd/[email protected]
go get github.com/makkes/gitlab-cli/cmd/[email protected]: github.com/makkes/[email protected]: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v3
The reason why this does not work is because the import path in the go.mod needs to contain the major version (if the major version != v0 or v1).
This commit adds the major version to the import path, hopefully I did not forget anything.
Signed-off-by: Ramon Rüttimann [email protected]