LoginSignup
1
1

More than 5 years have passed since last update.

goをhomebrewでインストールする

Last updated at Posted at 2019-02-23

brew update
brew upgrade
brew doctor
// doctorで問題がなかったら次へ

brew install goenv

// goenvのパスを通す
echo 'export PATH=$HOME/.goenv/bin:$PATH' >> ~/.bash_profile
echo 'eval $(goenv init -)' >> ~/.bash_profile
source ~/.bash_profile

goenv install -l
goenv install 1.11.4
goenv global 1.11.4

// goのパスを通す
echo 'export GOPATH=$HOME/go' >> ~/.bash_profile
echo 'export PATH=$PATH:$GOPATH/bin' >> ~/.bash_profile
source ~/.bash_profile

cd
mkdir go
cd go 
touch sample.go
sample.go
package main

import "fmt"

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

go run sample.go
 => hello,world

大変参考になりました。

Start App-Dev from 35.
Go開発環境構築(MacOS編)
https://startappdevfrom35.com/godevenvformacos/

初めてのgo!インストールまで。
https://qiita.com/inexp_eng4432/items/08dce692894c92ae08ee

1
1
4

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
1
1