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: cannot find module providing package error stops go get processing #34447

Closed
ardan-bkennedy opened this issue Sep 21, 2019 · 4 comments
Closed

Comments

@ardan-bkennedy
Copy link

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

$ go version
go version go1.13 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
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/bill/Library/Caches/go-build"
GOENV="/Users/bill/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/bill/code/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/bill/code/go/src/github.com/ardanlabs/service/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/f8/nl6gsnzs1m7530bkx9ct8rzc0000gn/T/go-build656499321=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Given this project
https://github.com/ardanlabs/service

I wanted to update all of the current dependencies to their current MVS. I updated a package I own and added a new tag. I ran the following command

$ go get -v all

What did you expect to see?

go: finding github.com/ardanlabs/conf v1.1.0
go: downloading github.com/ardanlabs/conf v1.1.0
go: extracting github.com/ardanlabs/conf v1.1.0

What did you see instead?

go: finding gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.3
get "gopkg.in/DATA-DOG/go-sqlmock.v1": found meta tag get.metaImport{Prefix:"gopkg.in/DATA-DOG/go-sqlmock.v1", VCS:"git", RepoRoot:"https://gopkg.in/DATA-DOG/go-sqlmock.v1"} at //gopkg.in/DATA-DOG/go-sqlmock.v1?go-get=1
go: finding gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.3
go get all: cannot find module providing package gopkg.in/DATA-DOG/go-sqlmock.v1

This seemed to break the go get call because my new version never got updated.

I had to run this command to get the latest version of the package

$ go get -v github.com/ardanlabs/conf
go: finding github.com/ardanlabs/conf v1.1.0
go: downloading github.com/ardanlabs/conf v1.1.0
go: extracting github.com/ardanlabs/conf v1.1.0
github.com/ardanlabs/conf

Given this error, I would have liked go get to continue to update the dependencies. This is now trouble because I can't update dependencies without knowing what to update.

I would like to know why this error is occurring on the Datadog packages as well.

@seankhliao
Copy link
Member

in module mode the update command is go get -u or go get -u=patch

@ardan-bkennedy
Copy link
Author

I'm experiencing that go get -u or go get -v is not working without the use of all. If I don't use all I get this error.

$ go get -u
go get .: path /Users/bill/code/go/src/github.com/ardanlabs/service is not a package in module rooted at /Users/bill/code/go/src/github.com/ardanlabs/service

Regardless, this error from the Datadog package is preventing go get to continue its work.

$ go get -u all
go: finding gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.3
go: finding gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.3
go get all: cannot find module providing package gopkg.in/DATA-DOG/go-sqlmock.v1

Then the question is, is there different behavior with all using or not using -u or -v?

@seankhliao
Copy link
Member

-u is for update, -v is for verbose output, go get -u works on the current package (which is non-existent at the root of your module), go get -u all works on all dependencies

your other error is from a name mismatch between the import name gopkg.in/DATA-DOG/go-sqlmock.v1 and the module name declared in that module github.com/DATA-DOG/go-sqlmock

@ardan-bkennedy
Copy link
Author

Thanks! I found the problem with the datadog issue. I needed a replace to point to a version of go-sqlmock that didn't have a modules file. This is not causing a new issue. I will close this and open a new issue.

Thanks for your help!!

@golang golang locked and limited conversation to collaborators Sep 20, 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

3 participants