Skip to content

go build should remove semantic versioning when determing file name #29643

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

Closed
firefart opened this issue Jan 9, 2019 · 2 comments
Closed

go build should remove semantic versioning when determing file name #29643

firefart opened this issue Jan 9, 2019 · 2 comments
Labels
FeatureRequest Issues asking for a new feature that does not need a proposal. FrozenDueToAge

Comments

@firefart
Copy link

firefart commented Jan 9, 2019

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

$ go version
go version go1.11.2 linux/amd64

Does this issue reproduce with the latest release?

yes

Tested with

docker run --rm -v $(pwd):/app -it golang:1.11.4 /bin/bash

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/firefart/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/firefart/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/golang"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build670649339=/tmp/go-build -gno-record-gcc-switches"

What did you do?

main.go

package main

import "fmt"

func main() {
  fmt.Println("Test")
}

go.mod

module github.com/user/project/v3

According to https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher we have to add the /v3/ for versions bigger than two which has been done here. After a go build or go build ./... the build finishes but produces a binary named v3 instead of project

What did you expect to see?

the name extracted from go.mod should have semantic versions stripped. In this case the binary name should be project

What did you see instead?

the binary is built as v3

@julieqiu julieqiu added the FeatureRequest Issues asking for a new feature that does not need a proposal. label Jan 10, 2019
@bcmills
Copy link
Contributor

bcmills commented Jan 11, 2019

Duplicate of #27283.

@bcmills bcmills closed this as completed Jan 11, 2019
@firefart
Copy link
Author

Thanks didn't find this issue when searching for it

@golang golang locked and limited conversation to collaborators Jan 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest Issues asking for a new feature that does not need a proposal. FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

4 participants