CygWinでgo get


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 = [email protected]
    name = yourname

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

動作確認

$ go get github.com/golang/example/hello