LoginSignup
8

More than 5 years have passed since last update.

go getでgopkg.inのパッケージが取得できないときgit configに追加すること

Last updated at Posted at 2017-02-07

確認したGitのバージョンは 2.11.1 です。
環境をいじっていたら go get でgopkg.inのパッケージが取得できないエラーが出るようになってしまいました。

$ git --version
git version 2.11.1

$ go get gopkg.in/yaml.v2
# cd .; git clone https://gopkg.in/yaml.v2 /Users/jiska/go/src/gopkg.in/yaml.v2
Cloning into '/Users/jiska/go/src/gopkg.in/yaml.v2'...
error: RPC failed; HTTP 301 curl 22 The requested URL returned error: 301
fatal: The remote end hung up unexpectedly
package gopkg.in/yaml.v2: exit status 128

gopkg.inのissue#50 にて同様事象のやりとりがされており、git configに設定追加でエラー解消できることがコメントされています。

$ git config --global http.https://gopkg.in.followRedirects true

これでgo getができるようになりました。感謝。

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
8