5
2

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 5 years have passed since last update.

Go事始めとGOPATHについて[macで]

Posted at

##0. install

備忘のために。

brew install go
go version 
# => go version go1.7.3

##1. GOPATH

とりあえずこれを読む。
GOPATHはgoで開発をする際に使われる環境変数

mkdir /User/yourname/mygo
echo "export GOPATH=/User/yourname/mygo" >> ~/.zshrc
echo 'export PATH="$GOPATH/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
  • goの開発をおこなうディレクトリを決める(e.g.> /User/yourname/mygo)。
  • bashrcやzshrcにGOPATHを設定する
  • 作成した/取得してきたGoアプリが動作するために、${GOPATH}/binにPATHを通しておく。
  • あとはいろいろなチュートリアルを読めばなんとなくわかる。go install,go buildとかgo getとか、、、
5
2
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
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?