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

时间:2019-12-23 17:41:54

标签: go

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.

1 个答案:

答案 0 :(得分:0)

执行以下步骤:

  1. go get github.com/golang/protobuf
  2. go run main.go