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

cmd/go: go module: cannot go get and require concrete commit of package #27118

Closed
albenik opened this issue Aug 21, 2018 · 1 comment
Closed

Comments

@albenik
Copy link

albenik commented Aug 21, 2018

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

go version go1.11rc1 darwin/amd64

Does this issue reproduce with the latest release?

YES

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/valbaev/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/valbaev/go"
GOPROXY=""
GORACE=""
GOROOT="/Users/valbaev/sdk/go1.11rc1"
GOTMPDIR=""
GOTOOLDIR="/Users/valbaev/sdk/go1.11rc1/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/valbaev/Projects/my/bzzz/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/fx/4r69fc5d0wg0nh49b69gkj_m0000gn/T/go-build297142414=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

  1. Create project based on https://github.com/labstack/echo, for example "Hello world" from here https://echo.labstack.com/guide
  2. Execute go mod init
  3. Execute go get github.com/labstack/echo@6d227dfea4d2e52cb76856120b3c17f758139b4e
  4. Execute go mod edit -require github.com/labstack/echo@6d227dfea4d2e52cb76856120b3c17f758139b4e
  5. Execute go mod tidy

What did you expect to see?

As described in https://tip.golang.org/cmd/go/#hdr-Pseudo_versions:
Pseudo-versions never need to be typed by hand: the go command will accept the plain commit hash and translate it into a pseudo-version (or a tagged version if available) automatically. This conversion is an example of a module query.

  1. After step 3, in $GOPATH/pkg/mod/github.com/labstack/ directory, I expect to see the subdirectory of echo package with pseudo-version pointed to specified commit 6d227dfea4d2e52cb76856120b3c17f758139b4e
  2. After step 5 I expect to thew record pointed to echo package with commit 6d227dfea4d2e52cb76856120b3c17f758139b4e

What did you see instead?

In project's go.mod file and in $GOPATH/pkg/mod/github.com/labstack/ directory always present only echo@v3.2.2-0.20180412143600-6d227dfea4d2+incompatible version.

@albenik
Copy link
Author

albenik commented Aug 21, 2018

Hmmm, my mistake!

Version echo@v3.2.2-0.20180412143600-6d227dfea4d2+incompatible is exactly points to commit 6d227dfea4d2e52cb76856120b3c17f758139b4e.

And tag v3.2.2 is not present in library repo.
So go mod silently incremented revision component of last known version.

@albenik albenik closed this as completed Aug 21, 2018
@golang golang locked and limited conversation to collaborators Aug 21, 2019
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

2 participants