我试图在本地为模块运行 godoc
但遇到了这个错误。
在我看来,godoc
依赖于 go list
,但不会以模块友好的方式运行 go list
。
ak/ (master) godoc -http=localhost:6060
using module mode; GOMOD=/Users/aaron/ak/go.mod
failed to determine the build list of the main module: go command exited unsuccessfully: exit status 1
go list -m: can't compute 'all' using the vendor directory
(Use -mod=mod or -mod=readonly to bypass.)
最佳答案
试试这个:
GO111MODULE=off godoc
看起来这个问题一直存在:https://github.com/golang/go/issues/33655
现在,我把它放在我的点文件中:
alias godoc='GO111MODULE=off godoc'
关于go - 如何在本地为模块运行 godoc?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62611164/