環境設定
Goをインストール for mac
https://golang.org/
からダウンロード
terminalからgoを実行
command not foundの場合、terminalを再起動
それでもダメな場合、PATHを通す
export GOPATH="$HOME/go"
export PATH="$GOPATH/go//bin/:$PATH"
パッケージをインストールしてみる
Goのドキュメントを見れるパッケージ
bash
$ go get golang.org/x/tools/cmd/godoc
https://godoc.org/golang.org/x/tools/cmd/godoc
$ godoc fmt
# go doc fmt.Printfにコマンドが現在では変更されているらしい
VSCodeでのデバッグのしかた
delveをインストール
$ go get -u github.com/derekparker/delve/cmd/dlv
VSCodeでGoの定義元に飛ぶ
// settings.json
"go.useLanguageServer": true