-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: better diagnostics for package missing in latest version #27102
Comments
I think you need to change - github.com/prometheus/client_golang/api/prometheus/v1
+ github.com/prometheus/client_golang/api in your import statement. |
@VojtechVitek that just imports a different package which I don't need. |
The problem is that github.com/prometheus/client_golang/api/prometheus/v1 does not exist in the latest tagged commit of github.com/prometheus/client_golang, which is v0.8.0 and is quite old. To get the latest commit on the master branch instead of the latest tagged commit, run:
Then your build will work. And maybe encourage the owners of github.com/prometheus/client_golang to tag v0.9.0. |
Leaving this issue open to track emitting a clearer error message in this case. I'd like to see something along the lines of "github.com/prometheus/client_golang v0.8.0 has no package github.com/prometheus/client_golang/api/prometheus" |
after a short discussion something like v0.9.0-pre.2 would be best for consistency with the other tags in the repo. Would vgo understand this? |
Change https://golang.org/cl/153459 mentions this issue: |
Use the actual loader result in findModule instead of making assumptions about nesting in the build list. As a side-effect, this produces much clearer error messages for packages that (for one reason or another) failed to load. Adjust the package and module path outside a module to "command-line-arguments". That string already appears in the output of a number of (module-mode and GOPATH-mode) commands for file arguments, and as far as I can tell operation outside a module is currently the only case in which the module path of a package is not actually a prefix of the import path. Fixes #28011 Fixes #27099 Fixes #28943 Updates #27102 Updates #28459 Updates #27063 Change-Id: I61d5556df7b1b7d1efdaffa892f0e3e95b612d87 Reviewed-on: https://go-review.googlesource.com/c/153459 Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Jay Conrod <[email protected]>
Using
I'm going to call this fixed. If folks run into similar circumstances where the diagnostic could be improved, please file a new issue to let us know! |
Related Issue: prometheus/client_golang#442
What version of Go are you using (
go version
)?go version go1.11rc1 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?What did you do?
What did you expect to see?
Success
What did you see instead?
The text was updated successfully, but these errors were encountered: