Skip to content

cmd/go: specifying module branch writes incorrect version tag to go.mod #31287

@paulbdavis

Description

@paulbdavis

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

$ go version
go version go1.12.1 linux/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"

What did you do?

Create a new go module

Getting a module by branch for testing using:

go get github.com/paulbdavis/go-version-issue@feature/branch

The repo has the branches set up as follows

86fe9a2 * origin/feature/branch-direct other feature stuff, direct from master with tag
4267841 | * origin/feature/branch feature changes
de1fa6d | *   origin/dev Merge branch 'master' into dev
        | |\  
        | |/  
        |/|   
a8fe481 * |   v0.2.0 origin/master Merge branch 'dev'
        |\ \  
        | |/  
3de82f8 | * v0.1.1-dev-tag dev change
        |/  
a7082b4 * v0.1.0 init

What did you expect to see?

I would expect the v0.2.0 tag to be used to generate the psuedo version, as it is the latest one

What did you see instead?

When getting the package it uses the v0.1.1-dev-tag tag to generate the psuedo version in the go.mod file

module github.com/paulbdavis/go-version-issue-consumer

go 1.12

require github.com/paulbdavis/go-version-issue v0.1.1-dev-tag.0.20190405180849-426784105212 // indirect

Getting the module on the feature/branch-direct generates a "correct" psuedo version based on v0.2.0 bumping it to v0.2.1?

module github.com/paulbdavis/go-version-issue-consumer

go 1.12

require github.com/paulbdavis/go-version-issue v0.2.1-0.20190405181040-86fe9a2567f5 // indirect

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.modules

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions