-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeGoCommandcmd/gocmd/goNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.modules
Milestone
Description
What version of Go are you using (go version)?
$ go version go version devel +1cd724acb6 Tue Feb 18 20:21:35 2020 +0000 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 GO111MODULE="" GOARCH="amd64" GOBIN="/tmp/tmp.iN3J3OviqO/bin" GOCACHE="/home/myitcv/.cache/go-build" GOENV="/home/myitcv/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/tmp/tmp.YATmfepfQp" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/home/myitcv/gos" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/home/myitcv/gos/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/tmp/tmp.iN3J3OviqO/go.mod" 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-build497027281=/tmp/go-build -gno-record-gcc-switches"
What did you do?
export GOPATH=$(mktemp -d)
cd $(mktemp -d)
export GOBIN=$PWD/bin
go mod init example.com/hello
go get -d github.com/myitcvscratch/[email protected]
go install github.com/myitcvscratch/main1
./bin/main1
gives:
Hello
and:
go version -m ./bin/main1
gives:
./bin/main1: devel +1cd724acb6 Tue Feb 18 20:21:35 2020 +0000
path github.com/myitcvscratch/main1
mod github.com/myitcvscratch/main1 v0.0.0-20200223195030-0e559444dd31 h1:ksuMuyNXJTVEqPoCW7OFo0yey/ijEj3Rxt56WwUPbD4=
Then:
go mod edit -replace=github.com/myitcvscratch/main1=github.com/myitcvscratch/[email protected]
go install github.com/myitcvscratch/main1
./bin/main1
gives:
Goodbye
But:
go version -m ./bin/main1
gives:
./bin/main1: devel +1cd724acb6 Tue Feb 18 20:21:35 2020 +0000
path github.com/myitcvscratch/main1
mod github.com/myitcvscratch/main1 v0.0.0-20200223195030-0e559444dd31 h1:ksuMuyNXJTVEqPoCW7OFo0yey/ijEj3Rxt56WwUPbD4=
i.e. the newly built binary does not include any information about the fact that github.com/myitcvscratch/main1 has been replaced, nor is any information about github.com/myitcvscratch/main2 included in the runtime/debug.BuildInfo
What did you expect to see?
Some reflection of the fact that github.com/myitcvscratch/main1 has been replaced with github.com/myitcvscratch/main2 in the runtime/debug.BuildInfo
What did you see instead?
As above
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeGoCommandcmd/gocmd/goNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.modules