dongshan7060 2018-09-24 07:30
浏览 75
已采纳

Golang Dep不会下载所有库文件

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?

  • 写回答

1条回答 默认 最新

  • dongtuo3795 2018-09-24 09:50
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 ansys fluent计算闪退
  • ¥15 有关wireshark抓包的问题
  • ¥15 需要写计算过程,不要写代码,求解答,数据都在图上
  • ¥15 向数据表用newid方式插入GUID问题
  • ¥15 multisim电路设计
  • ¥20 用keil,写代码解决两个问题,用库函数
  • ¥50 ID中开关量采样信号通道、以及程序流程的设计
  • ¥15 U-Mamba/nnunetv2固定随机数种子
  • ¥15 vba使用jmail发送邮件正文里面怎么加图片
  • ¥15 vb6.0如何向数据库中添加自动生成的字段数据。