我的项目使用Go 1.8,依赖于github.com/stretchr/testify。我使用go get -u github.com/stretchr/testify检索了最新版本,$GOPATH/src中的版本似乎是正确的。我在Gopkg.toml中添加了最新的版本号作为约束 name = "github.com/stretchr/testify"
version = "1.1.4"然后运行
因此,我的想法是在安装新依赖项时自动执行重复操作,方法是键入:并找到一种方法来获得github.com/stretchr/testify参数,而无需使用通常建议的繁重的参数名值声明FOO=bar (=> make install DEP=github.com/stretchr/testify)。当我这样做时,2 -: go get ${*}
它循环两次,首先不带任