I use docker library in my $GOPATH/src/github.com/docker
Now I try use dep. in my gopkg.toml, it has following description
[[constraint]]
name = "github.com/docker/docker"
version = "1.13.1"
But after dep init completed, all my codes tell me
Unresolved reference 'NewClientWithOpts'
But it works before I use dep.
client.NewClientWithOpts(client.WithVersion("1.38"))
When I look up my library from vendor. there are 105 files.
But from my src/github.com/docker/client
, It has 212 items!!
My question: Why dep not download all library files? How I solve this problem?
You have version 1.13.1 as your constraint in the Gopkg.toml
file, but NewClientWithOpts()
was introduced after that version. You could either try setting the constraint as branch = "master"
or revision = "<latest_commit_sha>"
, or use the v1.13.1 release and look at docs for that specific version.
dep
doesn't necessarily include all the files from a package - it only keeps sub-packages that are actually being used. That's not a problem in this case though.