2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

go getすると410 Goneのエラーが出る

Last updated at Posted at 2020-07-08

背景

GitHub Enterpriseのリポジトリに作成したリポジトリをgo get仕様とすると、 410 Gone のエラーが出た。

$ go get git.enterprise.com/repo/package
verifying git.enterprise.com/repo/package@v0.1.1/go.mod:
git.enterprise.com/repo/package@v0.1.1/go.mod: reading
https://sum.golang.org/lookup/git.enterprise.com/repo/package@v0.1.1: 410 Gone

sum.golang.org を経由せずにダウンロードしたい。

intelliJのGoModuleの設定確認

Preference > 言語&フレームワーク > Go Moduleの設定を確認。
プロキシーに「direct」が入ってなかったので入れる。
image.png

GOPRIVATEの設定をして再度 go get

$ GOPRIVATE="git.enterprise.com,direct"
$ go get -u git.enterprise.com/repo/package

intelliJの再起動

わたしは何故かintelliJの再起動までし無いと、IDE上で反映がされませんでしたので再起動をしました。

参考

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?