Skip to content

go.mod: replace can cause to have multiple instances of same package #36498

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
Pitasi opened this issue Jan 10, 2020 · 3 comments
Closed

go.mod: replace can cause to have multiple instances of same package #36498

Pitasi opened this issue Jan 10, 2020 · 3 comments
Labels
FrozenDueToAge modules WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@Pitasi
Copy link

Pitasi commented Jan 10, 2020

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

$ go version
go version go1.13.5 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=""
GOCACHE="/home/antonio/.cache/go-build"
GOENV="/home/antonio/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/antonio/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/tmp/inited_twice/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-build539111164=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Not sure if that's working as intended or it's a bug. My sample code can be found here: https://github.com/Pitasi/gomod-replace

What did you expect to see?

init
main: 43
main: 43

What did you see instead?

actual:

init
init
main: 43
main: 42
@bcmills
Copy link
Contributor

bcmills commented Jan 10, 2020

Please either write out the example code inline or link to a publicly-available repository.

@bcmills bcmills added modules WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Jan 10, 2020
@Pitasi
Copy link
Author

Pitasi commented Jan 10, 2020

sure sorry, here you go https://github.com/Pitasi/gomod-replace

I slightly changed my code to simplify even more.
New expected output

init
main: 43
main: 43

actual:

init
init
main: 43
main: 42

@bcmills
Copy link
Contributor

bcmills commented Jan 10, 2020

Duplicate of #34417

@bcmills bcmills marked this as a duplicate of #34417 Jan 10, 2020
@bcmills bcmills closed this as completed Jan 10, 2020
@golang golang locked and limited conversation to collaborators Jan 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants