-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: go build cannot find versioned package when in vendor folder #30798
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
Comments
Please give us the exact set of steps to reproduce this issue. |
@agnivade Thanks for your quick reply. The step is as follows:
package main import ( type Model struct { func main() {
vendor/github.com/colinmarc/hdfs/client.go:13:2: cannot find package "github.com/colinmarc/hdfs/v2/hadoopconf" in any of: Does this make sense? |
I did everything that is written in your instructions and probably realized what the problem is. Maybe you forgot to create a subfolder in vendor github.com. I create a subfolder that solved your problem. ├── main.go
├── temp
└── vendor
└── github.com
└── xitongsys |
Thanks @wenkaler I don't think I forgot the "github.com" folder. |
Sorry, @ljr900723. I explain, temp is binary file program. …/go/src/temp: tree -L 3
.
├── main.go
├── temp
└── vendor
└── github.com
└── xitongsys …/go/src/temp: ls -lah
total 16M
drwxr-xr-x 3 dmitriy dmitriy 4.0K Mar 14 18:00 .
drwxr-xr-x 10 dmitriy dmitriy 4.0K Mar 14 17:55 ..
-rw-r--r-- 1 dmitriy dmitriy 388 Mar 14 17:57 main.go
-rwxr-xr-x 1 dmitriy dmitriy 16M Mar 14 18:09 temp
drwxr-xr-x 3 dmitriy dmitriy 4.0K Mar 14 18:00 vendor |
Please correct me if I'm wrong, but this sounds more like a question that would be more appropriate for a forum, rather than a bug in Closing this issue, but please continue the conversation using the guidelines at https://golang.org/wiki/Questions or continue the discussion here. |
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
)?go env
OutputWhat did you do?
My project is based on "github.com/xitongsys" (which is based on "github.com/colinmarc/hdfs")
When I run "go build", there is no problem when those dependences are located in GOPATH/src.
When I move those dependences to myProject/vendor, and run "go build", the build will fail:
-->
vendor/github.com/colinmarc/hdfs/client.go:13:2: cannot find package "github.com/colinmarc/hdfs/v2/hadoopconf" in any of:
...
I know the "colinmarc/hdfs" uses the module-feature, and "github.com/colinmarc/hdfs/v2" is the name of module.
Can anybody help me and I cannot find any helpful information from the Internet.
What did you expect to see?
Build success
What did you see instead?
Build failed
The text was updated successfully, but these errors were encountered: