7
7

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.

golangインストール手順

Last updated at Posted at 2017-02-12

goインストール手順をメモ

1.[参考]インストール手順

2. homebrewをインストール

homebrewの詳細はhttps://liginc.co.jp/web/tool/mac-iphone/151069

ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)”
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew list
brew update

参考 unsitallコマンド

 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

3.homebrewからgoをインストール

brew search go
brew install go
go version
go version go1.7 darwin/amd64

4.環境変数設定

vim .bash_profile
  export GOROOT="go env GOROOT" or "/usr/local/opt/go/libexec"
  export GOPATH=$HOME/dev/go
  export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
source .bash_profile
go version
go version go1.7 darwin/amd64

5.hello world を確認

vim hello.go
	/* CSS declarations go here */

	package main
	import "fmt"

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

go run hello.go
hello world
7
7
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
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?