Open srinivas-kandula opened 5 years ago
dep ensure
is not part of the go
command.
It sounds like dep ensure
is for some reason copying packages already within your repo into its own vendor
directory. If that is the case, then the go
command could perhaps give a better error message, although since it likely only occurs in GOPATH
mode we're unlikely to prioritize a fix.
Have you tried it with the latest Go release (1.13.1
)? Does it still reproduce, and if so is the error message any more useful?
Getting same error message with go version go1.13.1 linux/amd64
go vet -composites=false ./... cmd/test-driver/main.go:13:2: use of internal package github.com/wavefrontHQ/wavefront-kubernetes-collector/vendor/github.com/wavefronthq/wavefront-kubernetes-collector/internal/options not allowed cmd/wavefront-collector/main.go:21:2: use of internal package github.com/wavefrontHQ/wavefront-kubernetes-collector/vendor/github.com/wavefronthq/wavefront-kubernetes-collector/internal/agent not allowed
@srinivas-kandula, can you confirm whether your repo's top-level vendor
directory contains copies of packages defined within that repo?
@bcmills Appreciate your quick replies.. yup it contains those directories. My top level dir:
$ ls cmd deploy docs Gopkg.lock Gopkg.toml internal LICENSE Makefile open_source_licenes.txt plugins README.md vendor
Vendor directory
/go/src/github.com/wavefrontHQ/wavefront-kubernetes-collector/vendor/github.com/wavefronthq/wavefront-kubernetes-collector
$ls internal LICENSE plugins
The fix on the go
side is a better diagnostic. modload.AmbiguousImportError
seems appropriate, except that it's not obvious to me that the package in a position to detect this error has access to that declaration and there are not actually any modules involved.
(Probably this will just be closed when GOPATH mode is deprecated, but you're welcome to close it earlier if you like, or contribute a short-lived fix if it is not too invasive.)
I think the real issue is with dep
, i am fine to close this issue. Kindly let me know if you have any workarounds/suggestions to overcome this issue?
As a workaround, you could rm -r vendor/github.com/wavefronthq/wavefront-kubernetes-collector
after you run dep ensure
.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?RHEL 8 (Ootpa)
go env
OutputWhat did you do?
What did you expect to see?
I was expecting the build to be successful
What did you see instead?