LoginSignup
4
5

More than 5 years have passed since last update.

MACにGolangをインストールしてみる〜HomeBrew編〜

Last updated at Posted at 2016-06-29

インストール

簡単ですね

$ sudo brew install go

動作確認1

$ go version
go version go1.6.2 darwin/amd64

環境変数設定

~/.bashrc
export GOPATH=$HOME/golang

動作確認2

hello.goを作成

hello.go
package main
import "fmt"

func main(){
    fmt.Printf("Hello, world\n")
}

実行

$ go run hello.go
Hello, world
4
5
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
4
5