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.modof your cloned version oforiginal-projectstill saysmodule github.com/y/original-project. You should use thego.modreplacedirective. 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所以有以上報(bào)錯(cuò)
3. pulsar分享
// TODO
4. 導(dǎo)致x509: certificate signed by unknown authority問題的原因
go get 時(shí)會(huì)先進(jìn)行 1 次 HTTPS GET 以獲取 go-import 數(shù)據(jù),而 HTTPS 網(wǎng)站的證書不受信任導(dǎo)致的(可能是沒有根證書或中間證書來驗(yàn)證 HTTPS 網(wǎng)站的證書是可信的)。
解決方案:
可以再go get的時(shí)候添加 -insecure
go get -insecure xxxx
這個(gè)可以解決單個(gè)go get的問題,但是針對(duì)類似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