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

cannot find module providing package gopkg.in/mattn/go-colorable.v0 #36

Closed
Amit-PivotalLabs opened this issue Jun 17, 2019 · 4 comments
Closed

Comments

@Amit-PivotalLabs
Copy link

I've used Kubebuilder to generate a bunch of code for a Kubernetes custom resource controller. I'd like my custom resource controller to manage BOSH releases so I've got code similar to this to construct a BOSH Director client to pass to my reconciliation controller so it can use it to manage BOSH releases. After adding this code to some of the Kubebuilder-generated code, and running make generate from the Kubebuilder-generated Makefile, it fails when I run go fmt ./....

$ go fmt ./...
go: downloading gopkg.in/mattn/go-colorable.v0 v0.1.2
go: downloading gopkg.in/mattn/go-isatty.v0 v0.0.8
build github.com/amitkgupta/boshv3: cannot load gopkg.in/mattn/go-colorable.v0: cannot find module providing package gopkg.in/mattn/go-colorable.v0

I'm not importing go-colorable directly anywhere in my code, my guess is some of the packages from github.com/cloudfoundry/bosh-cli that I'm importing have some recursive dependency on go-colorable, so I don't think I can solve this by modifying any import paths in my own code.

Any pointers on how I might troubleshoot this? I saw #35 but none of the ideas there seemed to help.

@mattn
Copy link
Owner

mattn commented Jun 17, 2019

If you want to fix this, please do NOT use gopkg.in.

@Amit-PivotalLabs
Copy link
Author

Thanks @mattn. I don't believe I'm using gopkg.in explicitly in anything I'm importing directly, but some transitive import dependency of my code may be doing so. When you say "do NOT use gopkg.in" would I need to change the import paths in some of these upstream dependencies, or is there something you think I can do that's more in my control (e.g. messing with my go.mod file in some way)?

@mattn
Copy link
Owner

mattn commented Jun 17, 2019

or is there something you think I can do that's more in my control (e.g. messing with my go.mod file in some way)?

Yes, or specify commit with the package name. See golang/go#30636

@Amit-PivotalLabs
Copy link
Author

Thanks, I addressed this by moving my repo somewhere under $GOPATH/src/github.com and deleting the go.mod files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants