Catalogue
Installing Go on MacOSX and Verifying It Runs

Installing Go on MacOSX and Verifying It Runs

🌐 日本語で読む

Environment

  • MacOSX 10.10.3 Yosemite

Installation Steps

Install with brew

1
$ brew install go

Check the Go version

1
$ go version

Add to .bash_profile

*If you use zsh, add this to ~/.zshrc instead

1
2
3
export GOROOT=/usr/local/opt/go/libexec
export GOPATH=$HOME
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

vim hello.go

1
2
3
4
5
6
7
package main

import "fmt"

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

Run the file

1
go run hello.go

If “Hello, World” is displayed, you’ve succeeded!
The Go installation is complete.

That’s all.

Installing Go on MacOSX and Verifying It Runs

https://kenzo0107.github.io/en/2015/05/18/install-go-macosx/

Author

Kenzo Tanaka

Posted on

2015-05-18

Licensed under