标签:image imp already dem img ready list git failed
D:\project\demo1\main>go run main.go
go: finding module for package github.com/sirupsen/logrus
main.go:4:2: module github.com/sirupsen/logrus: Get "https://proxy.golang.org/github.com/sirupsen/logrus/@v/list": dial tcp 172.217.27.145:443: connectex: A conn
ection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has fa
iled to respond.
分析上述报错可以看出是因为代理没有起作用的原因导致的
package main
import (
log "github.com/sirupsen/logrus"
)
func main() {
log.WithFields(log.Fields{
"animal": "walrus",
}).Info("A walrus appears")
}
go.mod
module main
go 1.14
ain>go env -w GOPROXY=https://goproxy.cn
再次执行
D:\project\demo1\main>go run main.go
go: finding module for package github.com/sirupsen/logrus
go: downloading github.com/sirupsen/logrus v1.6.0
D:\project\demo1\main>go mod init main
go mod init: go.mod already exists
成功
D:\project\demo1\main>go run main.go
time="2020-07-25T21:17:02+08:00" level=info msg="A walrus appears" animal=walrus
??!
标签:image imp already dem img ready list git failed
原文地址:https://www.cnblogs.com/zisefeizhu/p/13378321.html