douwanc63652 2018-01-20 20:47
浏览 286
已采纳

使用dep时强制特定版本的依赖项

I am using dep to manage the dependencies of a Go tool I'm writing.

This tool uses https://github.com/desertbit/grumble as an dependency. This in turn uses https://github.com/chzyer/readline as a dependency. The problem is that when trying to run my tool I get the following error: vendor/github.com/desertbit/grumble/app.go:295:20: unknown field 'HistorySearchFold' in struct literal of type readline.Config

I know why this is happending. grumble uses the master branch of readline as a dependency. In this the field HistorySearchFold is available. When using dep init/dep ensure not the master but the 1.4 tag is pulled into the vendor folder.

My question therefore is: How can I force dep to pull the master branch instead?

I tried adding the following in my Gopkg.toml file:

[[constraint]]
  branch = "master"
  name = "github.com/chzyer/readline"

Sadly this is not working. When I check the version pulled into the vendor folder it is still 1.4.

  • 写回答

1条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 ubuntu18.04 tty报错&tty界面su/sudo命令无法执行,如何解决?
      • ¥20 关于c语言网络编程,实现传文件和即时聊天
      • ¥20 下面的压缩方法是否可行
      • ¥15 结构体数组读取文件信息失败,读取不了
      • ¥15 kaldi thchs30 训练遇到问题
      • ¥15 shellter无法使用,如何解决?(操作系统-kali)
      • ¥15 matlab动态模态分解程序
      • ¥60 关于渗透及远控的几个问题
      • ¥15 python文本词汇出现次数统计
      • ¥15 使用按键和串口,记录按键在不消抖的情况下触发的次数