LoginSignup
2
3

More than 5 years have passed since last update.

CygWinでgo get

Last updated at Posted at 2017-01-30

Windowsにgoをインストールすれば、cygwin上でもgoの実行が可能ですが、go getを実行するには、GOPATHの設定が必要です。

cygwinでのGOPATHの設定

cygwinでのGOPATHの設定はexportコマンドで以下の様に行います

$ export GOPATH=d:\\cygwin\\home\\username\\go

go getのための設定

加えて以下の設定を行っておくと困らないと思います。

githubの設定

~/.ssh/id_rsa_githubにSSH KEYを配置
~/.ssh/config を以下のように設定

Host github.com
    User git
    Hostname github.com
    IdentityFile /home/username/.ssh/id_rsa_github

httpsで処理できるように証明書を配置

http://curl.haxx.se/docs/caextract.html
から最新のcacert.pemをダウンロードして
~/.ssh/cacert.pem
に配置

~/.gitconfigを以下のように設定

[user]
    email = your.email@your.domain
    name = yourname

[http]
    sslcainfo = ~/.ssh/cacert.pem

動作確認

$ go get github.com/golang/example/hello
2
3
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
3