golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.73k stars 17.63k forks source link

cmd/go: error loading module requirements #31162

Closed gertcuykens closed 5 years ago

gertcuykens commented 5 years ago

go1.12.1 darwin/amd64

This works

gert@gert ~/ go get -u github.com/junegunn/fzf

But this doesn't

gert@gert ~/ GO111MODULE=on go get -u github.com/junegunn/fzf
go: finding github.com/junegunn/fzf latest
go: finding github.com/smartystreets/assertions latest
go: finding github.com/gopherjs/gopherjs latest
go: finding github.com/smartystreets/goconvey latest
go: finding golang.org/x/sys latest
go: finding golang.org/x/crypto latest
go: finding golang.org/x/net latest
go: finding golang.org/x/tools latest
go: gopkg.in/DATA-DOG/go-sqlmock.v1@v1.3.3: go.mod has non-....v1 module path "github.com/DATA-DOG/go-sqlmock" at revision v1.3.3
go get: error loading module requirements

When following the dependency tree I have no idea why I need go-sqlmock.v1 in the first place for this package?

Also the error message doesn't make sense because there is a version v1.3.3

https://gopkg.in/DATA-DOG/go-sqlmock.v1

gert@gert ~/ go env
GOARCH="amd64"
GOBIN="/Users/gert/go/bin"
GOCACHE="/Users/gert/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/gert/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.1/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/dv/8tlwvjr91zjdyq4rk14lkkfm0000gn/T/go-build037051093=/tmp/go-build -gno-record-gcc-switches -fno-common"
gertcuykens commented 5 years ago

https://stackoverflow.com/questions/55430150/go111module-on-error-loading-module-requirements

Got confirmation on stack overflow what is going on. Still believe a more detailed error message by Go can be achieved here.