我正在尝试为模块在本地运行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.)
答案 0 :(得分:0)
尝试一下:
GO111MODULE=off godoc
好像有一个持续存在的问题:https://github.com/golang/go/issues/33655
现在,我将其放在我的点文件中:
alias godoc='GO111MODULE=off godoc'