profile
viewpoint

Ask questionscmd/go: cannot find module providing package error stops `go get` processing

<!-- Please answer these questions before submitting your issue. Thanks! -->

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

<pre> $ go version go version go1.13 darwin/amd64 </pre>

Does this issue reproduce with the latest release?

Yes

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

<details><summary><code>go env</code> Output</summary><br><pre> $ 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" </pre></details>

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.

golang/go

Answer questions ardan-bkennedy

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?

useful!

Related questions

cmd/link: segmentation fault during mach-o linking
vendor/golang.org/x/xerrors/adaptor_go1_13.go:16:14: undefined: errors.Frame ... hot 2
cmd/vet: potential false positive in the "suspect or" check hot 2
internal/poll: transparently support new linux io_uring interface hot 2
cmd/go: needs a better error than "missing dot in first path element" when GOROOT is set incorrectly hot 2
x/xerrors: fails to compile on tip hot 1
cmd/go: `go clean <package>` downloads modules hot 1
cmd/cgo error: runtime: unknown pc 0x7fff5c805b86 hot 1
runtime: crash with "invalid pc-encoded table" hot 1
cmd/link: showing many ld warnings of "building for macOS, but linking in object file" hot 1
runtime: go program crach, it seems fall into infinite loop hot 1
cmd/go: major version without preceding tag must be v0, not v1 - breaks build of github.com/go-check hot 1
gollvm: Using External Go Packages with gollvm hot 1
runtime: macOS Sierra builders spinning hot 1
cmd/go: Problem using go modules hot 1
Github User Rank List