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

Allow go get -u to upgrade replacements #33456

Closed
andig opened this issue Aug 4, 2019 · 3 comments
Closed

Allow go get -u to upgrade replacements #33456

andig opened this issue Aug 4, 2019 · 3 comments

Comments

@andig
Copy link
Contributor

andig commented Aug 4, 2019

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

$ go version
go version go1.12.7 darwin/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
❯ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/andig/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/andig/htdocs/go"
GOPROXY="https://proxy.golang.org"
GORACE=""
GOROOT="/usr/local/opt/go/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/andig/htdocs/mbmd/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/w5/_c0nb6n90fn96tzw04dtc6240000gn/T/go-build121491140=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I'm using a module replacement:

replace github.com/crabmusket/gosunspec => github.com/andig/gosunspec v0.0.0-20190802074646-9596f4c956e3

Doing

go get -u github.com/andig/gosunspec@rollup

does not update the replacement I have in go.mod to the latest commit available. Instead, it adds it as new requirements.

What did you expect to see?

It would be nice if the replacements allowed upgrading too. Currently it doesn't, instead it adds the module to the required modules and I manually need copy the commit across to the replacement line plus remove the added module.

Granted this is probably not too common but would be nice.

@shivi28
Copy link
Contributor

shivi28 commented Aug 5, 2019

@andig Do you have require github.com/crabmusket/gosunspec in your go.mod file. Please check this #29299 PR for reference. It might be useful for you.

@andig
Copy link
Contributor Author

andig commented Aug 5, 2019

Do you have require github.com/crabmusket/gosunspec in your go.mod file

Yes, I do (https://github.com/volkszaehler/mbmd/blob/master/go.mod#L4).

I've read both #29299 and #26241 now, it seems they are about not having to write the actual require when using replace.
Neither seems to mention the missing upgrade behaviour of go get -u with replace?

@bcmills
Copy link
Contributor

bcmills commented Aug 5, 2019

Duplicate of #32721

@bcmills bcmills marked this as a duplicate of #32721 Aug 5, 2019
@bcmills bcmills closed this as completed Aug 5, 2019
@golang golang locked and limited conversation to collaborators Aug 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants