当下载Golang的MongoDB驱动程序时出现403禁止访问的错误。

huangapple go评论83阅读模式
英文:

403 forbidden when downloading mongoDB driver for golang

问题

我正在尝试在VS Code的项目中使用以下命令下载MongoDB的Golang驱动程序:

go get go.mongodb.org/mongo-driver/mongo

但是我遇到了403禁止错误,错误信息如下:

go: downloading github.com/klauspost/compress v1.13.6
go.mongodb.org/mongo-driver/mongo imports
        github.com/klauspost/compress/zstd: github.com/klauspost/compress@v1.13.6: reading https://proxy.golang.org/github.com/klauspost/compress/@v/v1.13.6.zip: 403 Forbidden

我猜想可能是我的IP地址受限制,所以我尝试使用几个VPN(如psiphon和hotspot shield)进行下载,但仍然遇到相同的错误。

英文:

I'm trying to download mongoDB golang driver to a project in VS code running this command in the VS code terminal:

go get go.mongodb.org/mongo-driver/mongo

but I'm getting 403 forbidden error like this:

go: downloading github.com/klauspost/compress v1.13.6
go.mongodb.org/mongo-driver/mongo imports
        github.com/klauspost/compress/zstd: github.com/klauspost/compress@v1.13.6: reading https://proxy.golang.org/github.com/klauspost/compress/@v/v1.13.6.zip: 403 Forbidden

I've figured maybe my ip address is restriced so I've tried downloading it using several VPNs like psiphon and hotspot shield but I'm still getting the same error.

答案1

得分: 1

你可以通过以下方式暂时跳过使用GOPROXY:

GORPOXY='direct' go get YOUR_URL

这样,它会跳过goproxy的检查,直接从提供的目标地址下载你的仓库。

英文:

You can temporarily skip using GOPROXY by:

GORPOXY='direct' go get YOUR_URL

This way, it skips the goproxy checking and directly downloads your repo from provided destination.

huangapple
  • 本文由 发表于 2021年12月13日 16:51:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/70331970.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定