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

标签 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.

最佳答案

执行以下步骤:

  • go get github.com/golang/protobuf
  • go run main.go
  • 关于go - 为什么不能加载golang/protobuf/proto,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59459304/

    相关文章:

    regex - 去正则表达式字符串验证

    go - 我需要在迭代闭包上下文时为其自身分配一个变量以保持正确的值

    arrays - 为什么在 Go 中有数组?

    xml - 嵌套的 xml golang 中的解码属性

    go - 在 Go 中获取最新的 "Monday 05:30"Unix 时间?

    postgresql - Call to Query with args [],在复合 SQL 查询的 go-sqlmock 中不是预期的

    file-io - Golang语法错误: unexpected EOF while writing to a file

    go - 在 IntelliJ 中导入 Go 项目不起作用

    rest - 混合命名和未命名函数参数

    go - 如何在单元格中获取输入