Help us understand the problem. What is going on with this article?

golangインストール手順

More than 3 years have passed since last update.

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

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

https://blog.yohei.org/go-golang-install/

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
uzabase
企業活動の意思決定を支える情報インフラの提供
https://www.uzabase.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away