go 上的 quic 服务器错误是什么以及如何修复它?

go 上的 quic 服务器错误是什么以及如何修复它?

当我尝试在 go 上启动 quic 服务器时,出现一个错误,这是什么意思?

本项目的Github地址:https://github.com/lucas-clemente/quic-go

    skly@sklypc:/test/goquic/quic-go$ go run example/main.go -bind 
    "0.0.0.0:6121"
example/main.go:20:2: cannot find package "github.com/lucas-clemente/quic-go" in any of:
    /usr/lib/go-1.10/src/github.com/lucas-clemente/quic-go (from $GOROOT)
    /home/skly/go/src/github.com/lucas-clemente/quic-go (from $GOPATH)
example/main.go:21:2: cannot find package "github.com/lucas-clemente/quic-go/http3" in any of:
    /usr/lib/go-1.10/src/github.com/lucas-clemente/quic-go/http3 (from $GOROOT)
    /home/skly/go/src/github.com/lucas-clemente/quic-go/http3 (from $GOPATH)
example/main.go:22:2: cannot find package "github.com/lucas-clemente/quic-go/integrationtests/tools/testserver" in any of:
    /usr/lib/go-1.10/src/github.com/lucas-clemente/quic-go/integrationtests/tools/testserver (from $GOROOT)
    /home/skly/go/src/github.com/lucas-clemente/quic-go/integrationtests/tools/testserver (from $GOPATH)
example/main.go:23:2: cannot find package "github.com/lucas-clemente/quic-go/internal/testdata" in any of:
    /usr/lib/go-1.10/src/github.com/lucas-clemente/quic-go/internal/testdata (from $GOROOT)
    /home/skly/go/src/github.com/lucas-clemente/quic-go/internal/testdata (from $GOPATH)
example/main.go:24:2: cannot find package "github.com/lucas-clemente/quic-go/internal/utils" in any of:
    /usr/lib/go-1.10/src/github.com/lucas-clemente/quic-go/internal/utils (from $GOROOT)
    /home/skly/go/src/github.com/lucas-clemente/quic-go/internal/utils (from $GOPATH)
example/main.go:25:2: cannot find package "github.com/lucas-clemente/quic-go/quictrace" in any of:
    /usr/lib/go-1.10/src/github.com/lucas-clemente/quic-go/quictrace (from $GOROOT)
    /home/skly/go/src/github.com/lucas-clemente/quic-go/quictrace (from 
   $GOPATH)

答案1

检查自述(它也在您提供的链接的末尾)。它说您应该运行 Go 1.13+(并且您正在运行 1.10)。您还应该启用模块并加载依赖项。

如果按照该文档操作后仍然有问题,你可以提出问题

相关内容