2021-04-19

lucasgao · · 1428 次点击 · · 开始浏览    
这是一个创建于 的文章,其中的信息可能已经有所发展或是发生改变。

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 of original-project still says module github.com/y/original-project. You should use the go.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. 导致x509: certificate signed by unknown authority问题的原因

go get 时会先进行 1 次 HTTPS GET 以获取 go-import 数据,而 HTTPS 网站的证书不受信任导致的(可能是没有根证书或中间证书来验证 HTTPS 网站的证书是可信的)。

解决方案:

可以再go get的时候添加 -insecure

go get -insecure xxxx

这个可以解决单个go get的问题,但是针对类似go mod的命令就无能为力, 所以还有另外一种办法:将证书文件 导入到相应目录,并执行证书更新

// 证书导入
cp **** /etc/pki/ca-trust/source/anchors/
// 执行更新
update-ca-trust

5. logur

参考链接https://logur.dev/logur

6. missing go.sum entry for module providing package XXXX

fix by run go mod download or go mod tidy


有疑问加站长微信联系(非本文作者)

本文来自:简书

感谢作者:lucasgao

查看原文:2021-04-19

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

1428 次点击  
加入收藏 微博
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传