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 我想在一个软件里添加一个优惠弹窗,应该怎么写代码
  • ¥15 fluent的在模拟压强时使用希望得到一些建议
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流