const (
Address = ":50051"
)
func main() {
listen, err := net.Listen("tcp", Address)
if err != nil {
log.Fatalf("failed to listen: %v", err)
}
log.Printf("listen on: %s\n", Address)
}
当我运行时:
go run main.go
我收到此错误:build command-line-arguments: cannot load github.com/golang/protobuf/proto: module github.com/golang/protobuf/proto: Get https://proxy.golang.org/github.com/golang/protobuf/proto/@v/list: dial tcp 216.58.200.241:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established
connection failed because connected host has failed to respond.
最佳答案
执行以下步骤:
go get github.com/golang/protobuf
go run main.go
关于go - 为什么不能加载golang/protobuf/proto,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59459304/