【Go学习】macOS+IDEA terminal执行godoc -http=:8000(即本地启动Go文档),提示command not found: godoc

【问题】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/[email protected]: verifying module: golang.org/x/[email protected]: Get "https://sum.golang.org/lookup/golang.org/x/[email protected]": 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

【效果】浏览器打开:http://127.0.0.1:8000/pkg/

【Go学习】macOS+IDEA terminal执行godoc -http=:8000(即本地启动Go文档),提示command not found: godoc_第1张图片

你可能感兴趣的:(Golang学习,idea,golang,学习,macos)