无法在 mac 上运行 ginkgo bootstrap 命令

Usm*_*jid 7 go ginkgo

当我运行这个命令时

ginkgo bootstrap 
Run Code Online (Sandbox Code Playgroud)

我收到这个错误

zsh: command not found: ginkgo 
Run Code Online (Sandbox Code Playgroud)

我已经使用以下命令安装了 ginkgo

go get -u github.com/onsi/ginkgo/ginkgo 
Run Code Online (Sandbox Code Playgroud)

我无法理解我做错了什么?

Noa*_*nos 18

按照此处所述安装 Ginkgo 后,例如最新版本:

go env -w GO111MODULE=on
go install github.com/onsi/ginkgo/v2/ginkgo@latest
go get github.com/onsi/gomega/...
Run Code Online (Sandbox Code Playgroud)

确保 GO bin 在您的 PATH 中:

go env GOPATH # /home/user/go
export PATH=$PATH:$(go env GOPATH)/bin
Run Code Online (Sandbox Code Playgroud)

现在尝试运行 Ginkgo:

ginkgo bootstrap
Generating ginkgo test suite bootstrap for temp in:
    temp_suite_test.go
Run Code Online (Sandbox Code Playgroud)