1. fix parsing go.mod module declares its path as “x” but was required as “y”
I think the problem comes from the fact that the
go.mod
of your cloned version oforiginal-project
still saysmodule github.com/y/original-project
. You should use thego.mod
replace
directive. It is meant for cases like yours exactly.
a question about fork
2. go:embed requires go1.16 or later (-lang was set to go1.14; check go.mod)
go mod中聲明的go版本是go1.14所以有以上報錯
3. pulsar分享
// TODO
4. 導(dǎo)致x509: certificate signed by unknown authority問題的原因
go get 時會先進行 1 次 HTTPS GET 以獲取 go-import
數(shù)據(jù)惩激,而 HTTPS 網(wǎng)站的證書不受信任導(dǎo)致的(可能是沒有根證書或中間證書來驗證 HTTPS 網(wǎng)站的證書是可信的)。
解決方案:
可以再go get的時候添加 -insecure
go get -insecure xxxx
這個可以解決單個go get的問題,但是針對類似go mod
的命令就無能為力, 所以還有另外一種辦法:將證書文件 導(dǎo)入到相應(yīng)目錄材失,并執(zhí)行證書更新
// 證書導(dǎo)入
cp **** /etc/pki/ca-trust/source/anchors/
// 執(zhí)行更新
update-ca-trust
5. logur
6. missing go.sum entry for module providing package XXXX
fix by run go mod download
or go mod tidy