gpt4 book ai didi

go - 为什么不能加载golang/protobuf/proto

转载 作者:行者123 更新时间:2023-12-01 22:37:17 24 4
gpt4 key购买 nike

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/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com