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: spurious error about import comments with vendoring #13531
Comments
I can't reproduce this using either current development branch or Go 1.5. Can you post a file tree and exact command? This is what I tried:
Thanks. |
I should add that import comments are supposed to be ignored in vendor directories, per golang.org/s/go15vendor. |
I'm using the govendoring in :
Please let me know in case I'm doing any mistake |
Hi @rsc My Bad : Missed to export |
Reopening issue: if the problem is that the vendor experiment was turned off, then I would expect a clearer error. Reading the message, I don't understand what is doing the "importing". (Perhaps nothing, which is the problem with the message.) |
I looked at this some more and I don't have a clear way to give a better error without second-guessing pre-existing uses of the word "vendor". The problem of forgetting to turn GO15VENDOREXPERIMENT on is gone in Go 1.6, since it's on by default. So I think it's safe to do nothing here after all. |
In a golang project I was using govendoring in golang 1.5.2.
I have to use a 3rd party library called :
github.com/Shopify/sarama
It uses another 3rd party library called:
github.com/golang/snappy
Now both of the 3rd party library was present in the :
<<project_dir>>/vendor/
Now due to a comment describing the import in snappy:
package snappy // import "github.com/golang/snappy"
the following error is coming:
can't load package: package <<project_path>>/vendor/github.com/golang/snappy: code in directory <project_absolute_path>/vendor/github.com/golang/snappy expects import "github.com/golang/snappy"
I checked by creating the situation manually and the error is the same.
src ---> <<project_package>> ----> <<somefile>>.go || import "github.com/example/a"
|
|--------> vendor ----> github.com ---> example -----> a || import "github.com/example/b"
|--------> vendor ----> github.com ---> example -----> b || package b // import "github.com/example/b"
So the Below statement about Custom Import Path Checking:
The go command will refuse to install a package if the default install path does not match the documented import path.
Probably the reason behind the error is the vendor path and Import Path checking.
The text was updated successfully, but these errors were encountered: