参考URL
公式サイト:https://golang.org
環境
macOS High Sierra バージョン10.13.6
GO 1.12
インストール
$ brew install go
==> Downloading https://homebrew.bintray.com/bottles/go-1.12.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring go-1.12.high_sierra.bottle.tar.gz
� /usr/local/Cellar/go/1.12: 9,787 files, 449.7MB
brew install go 35.23s user 41.35s system 53% cpu 2:23.62 total
$ go version
go version go1.12 darwin/amd64
動作確認
公式サイトのソースを動かしてみる
$vi hello.go
// You can edit this code!
// Click here and start typing.
package main
import "fmt"
func main() {
fmt.Println("Hello, 世界")
}
$go run hello.go
Hello, 世界
ビルド
$go build hello.go
$ls
hello hello.go
$./hello
Hello, 世界