我想导入一个 Go 模块,其 go.mod
中包含以下内容:
> grep plist go.mod
github.com/DHowett/go-plist v0.0.0-20180609054337-500bd5b9081b
howett.net/plist v0.0.0-20181124034731-591f970eefbb // indirect
但是,如果我尝试go get
该包,我会收到以下错误消息:
go: github.com/DHowett/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c4a3abe9b4a8adb7b084b2f4eaf4eaf4e9f6f4f5fcf5f5f6f0f4f7f0f3f7f5e9f1fdf5a2fdf3f4a1a1a2a6a6" rel="noreferrer noopener nofollow">[email protected]</a>: parsing go.mod: unexpected module path "howett.net/plist"
go get: error loading module requirements
如果我只是尝试 go get github.com/DHowett/go-plist
,我也会收到此错误:
> go get github.com/DHowett/go-plist
go: finding github.com/DHowett/go-plist latest
go: github.com/DHowett/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="afc8c082dfc3c6dcdbefd99f819f819f829d9f9e979e9e9d9b9f9c9b989c9e829a969ec996989fcacac9cdcd" rel="noreferrer noopener nofollow">[email protected]</a>: parsing go.mod: unexpected module path "howett.net/plist"
go: error loading module requirements
如何修复此错误以便导入该模块?
最佳答案
该模块的标识为 go.mod
定义为 howett.net/plist
而不是 github.com/DHowett/go-plist
。
如果你运行这个,它应该可以正常工作:
go get howett.net/plist
另请参阅this entry在官方 Golang Wiki 中
关于go - 解析go.mod : unexpected module path "howett.net/plist",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58598354/