Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: go mod verify replaces tags manually set in go.mod #27271

aanm opened this issue Aug 27, 2018 · 2 comments


None yet
5 participants
Copy link

commented Aug 27, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.11 linux/amd64

Does this issue reproduce with the latest release?


What operating system and processor architecture are you using (go env)?


What did you do?

Create a main.go file with:

package main

import (

func main() {

Have the go.mod file written with the content

module aanm/tests

require ( kubernetes-1.11.2

run GO111MODULE=on go mod tidy

Verify the content of go.mod and notice kubernetes-1.11.2 was not kept nor a reference to the tag manually set.

module aanm/tests

require ( v1.1.1 // indirect v1.0.0 // indirect v1.1.1 // indirect v0.0.0-20160126235308-23def4e6c14b // indirect v1.2.0 // indirect v0.0.0-20180813153112-4030bb1f1f0c // indirect v0.0.0-20170612174753-24818f796faf // indirect v0.2.0 // indirect v0.0.0-20180305231024-9cad4c3443a7 // indirect v1.1.5 // indirect v0.0.0-20180306012644-bacd9c7ef1dd // indirect v1.0.1 // indirect v2.0.1+incompatible // indirect v1.0.0 // indirect v1.0.2 // indirect v1.2.2 // indirect v0.0.0-20180820150726-614d502a4dac // indirect v0.0.0-20180826012351-8a410e7b638d // indirect v0.0.0-20180314180146-1d60e4601c6f // indirect v0.0.0-20180824143301-4910a1d54f87 // indirect v0.3.0 // indirect v0.0.0-20180412165947-fbb02b2291d2 // indirect v0.9.1 // indirect v2.2.1 // indirect v0.0.0-20180827053216-6b5087e25236 // indirect v0.0.0-20180823151430-017bf4f8f588 // indirect v2.0.0-alpha.0.0.20180806134042-1f13a808da65+incompatible

What did you expect to see?

  1. The to keep tag kubernetes-1.11.2

(nice to have but not important)
2. All the indirect dependencies are extremely verbose. If I care about them I would check go.sum, I don't see the point on filling up the require, which IMO should be kept by the developer, to be filled up with transient dependencies.


This comment has been minimized.

Copy link

commented Aug 27, 2018

In case this helps, a couple quick initial comments regarding "the kubernetes-1.11.2 tag is not kept", along with some pointers to some possibly related doc.

The VCS tag kubernetes-1.11.2 will not be interpreted a semver tag by the go tooling.

For a VCS tag to be interpreted as a semver tag by the go tooling, the tag must encode a semantic version in the form v(major).(minor).(patch), such as v0.1.0, v1.2.3, or v3.0.1. The leading v is required by the go tooling.

A non-semver tag used in a require directive or in go get will be interpreted as a "Module query".

In general, module queries that do not resolve to a semver tag will be recorded as pseudo-versions in the go.mod file.

The "Module-aware go get" and "Module queries" sections of the tip documentation have a bit more info on these topics...

@gopherbot please add label modules

@gopherbot gopherbot added the modules label Aug 27, 2018

@FiloSottile FiloSottile added this to the Go1.12 milestone Aug 30, 2018


This comment has been minimized.

Copy link

commented Sep 27, 2018

@thepudds has the correct diagnosis. kubernetes-1.11.2 is not a valid semantic version, so it gets replaced by one that is.

The closest we could get while sticking to semantic versions is #25898, so I'm closing this as a duplicate of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.