How to build with glide?
Closed this issue · 2 comments
Deleted user commented
I'm using golang v1.6.1, and glide for vendor manage.
I run
glide rebuild
In my project, which has been add to $GOPATH, get error:
[WARN] The rebuild command is deprecated and will be removed in a future version
[WARN] Use the go install command instead
[INFO] Building dependencies.
[INFO] Running go build github.com/bmatsuo/lmdb-go
[WARN] Failed to run 'go install' for github.com/bmatsuo/lmdb-go: can't load package: package ./vendor/github.com/bmatsuo/lmdb-go: no buildable Go source files in /Users/zwb/Code/Go/queue/vendor/github.com/bmatsuo/lmdb-go
I hope to build lmdb-go first, so I can get auto-complete with gocode set lib-path.
bmatsuo commented
I think the problem is that glide needs you to specify subpackages explicitly. The lmdb package is at import path github.com/bmatsuo/lmdb-go/lmdb, not just github.com/bmatsuo/lmdb-go.
I think something like the following is what you need in your glide.yaml file in order to vendor lmdb-go with glide:
import:
- package: github.com/bmatsuo/lmdb-go
subpackages: [lmdb]
And, to make use of other subpackages like exp/lmdbsync you would just add them to the subpackages array.
Deleted user commented
@bmatsuo Thank you, this sloved my problem.