【问题】IDEA terminal执行godoc -http=:8000,提示command not found: godoc
~/LearnGoWithTests/hello godoc -http=:8000
zsh: command not found: godoc
【解决】godoc需要单独安装一下(1查2装)
# 1查
~/LearnGoWithTests/hello go get -u golang.org/x/tools/cmd/godoc
go: downloading golang.org/x/tools v0.17.0
go: golang.org/x/tools/cmd/godoc: golang.org/x/tools@v0.17.0: verifying module: golang.org/x/tools@v0.17.0: Get "https://sum.golang.org/lookup/golang.org/x/tools@v0.17.0": EOF
# 2装
~/LearnGoWithTests/hello go install golang.org/x/tools/cmd/godoc@latest
go: downloading golang.org/x/tools v0.17.0
go: downloading golang.org/x/mod v0.14.0
go: downloading github.com/yuin/goldmark v1.4.13
【效果】再次terminal执行godoc -http=:8000
~/LearnGoWithTests/hello godoc -http=:8000
using module mode;GOMOD=/Volumes/mac/study/goRoot/LeetCodeGoLangWJ/LearnGoWithTests/hello/go.mod
go: no module dependencies to download