如何安装”gotests”命令?

huangapple go评论66阅读模式
英文:

How to install "gotests" command?

问题

我需要在Go中使用测试驱动开发,使用"gotests"命令。

gotests -all *

这个命令不起作用。我已经执行了go get -u /github.com/cweill/gotestsgo install。但是在$GOPATH/bin目录下没有生成可执行文件。

英文:

I need to use the test driven development in Go using "gotests" command.

gotests -all *

This is not working. I did go get -u /github.com/cweill/gotests
and go install. But there is no binary created in $GOPATH/bin.

答案1

得分: 6

由于没有主要的包,使用以下命令:

$ go get github.com/cweill/gotests/...

这个命令会下载当前包的所有依赖,并创建一个二进制文件。在下载完这个包后,可以在$GOPATH/bin目录下找到一个名为gotests的二进制文件。

更多信息请参见这里

英文:

since there is NO main package, Use this command

$ go get github.com/cweill/gotests/...

this itself download all dependencies for the current package, and creates bin file, after downloading this package. see in $GOPATH/bin there will be a bin file named gotests

for more see HERE

答案2

得分: 4

以下是我为您翻译的内容:

以下是我在使用go v1.19.1时成功的方法:

go install github.com/cweill/gotests/gotests@latest

自从1.18版本以后,使用go get安装工具已被禁用。请参阅Deprecation of 'go get' for installing executables

英文:

The following worked for me with go v1.19.1

go install github.com/cweill/gotests/gotests@latest

Using go get to install things has been disabled since 1.18. See Deprecation of 'go get' for installing executables

答案3

得分: 1

go install github.com/rakyll/gotest

来源:https://github.com/rakyll/gotest

英文:
go install github.com/rakyll/gotest 

Source: https://github.com/rakyll/gotest

huangapple
  • 本文由 发表于 2016年11月21日 21:44:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/40721668.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定