You've already forked minio-cookbook
mirror of
https://github.com/astaxie/cookbook.git
synced 2025-08-08 09:42:04 +03:00
Doc: Realigned the content home and moved cookbook content inside docs directory. (#45)
This commit is contained in:
committed by
Harshavardhana
parent
55a8a5bd21
commit
29546a45e8
121
docs/how-to-install-golang.md
Normal file
121
docs/how-to-install-golang.md
Normal file
@@ -0,0 +1,121 @@
|
||||
# How to install Golang? [](https://gitter.im/minio/minio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
## Ubuntu (Kylin) 14.04
|
||||
|
||||
### Build Dependencies
|
||||
|
||||
This installation document assumes Ubuntu 14.04+ on x86-64 platform.
|
||||
|
||||
##### Install Git, GCC
|
||||
|
||||
```sh
|
||||
|
||||
$ sudo apt-get install git build-essential
|
||||
|
||||
```
|
||||
|
||||
##### Install Go 1.6+
|
||||
|
||||
Download Go 1.6+ from [https://golang.org/dl/](https://golang.org/dl/).
|
||||
|
||||
```sh
|
||||
|
||||
$ wget https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz
|
||||
$ mkdir -p ${HOME}/bin/
|
||||
$ mkdir -p ${HOME}/go/
|
||||
$ tar -C ${HOME}/bin/ -xzf go1.6.linux-amd64.tar.gz
|
||||
|
||||
```
|
||||
|
||||
##### Setup GOROOT and GOPATH
|
||||
|
||||
Add the following exports to your ``~/.bashrc``. Environment variable GOROOT specifies the location of your golang binaries
|
||||
and GOPATH specifies the location of your project workspace.
|
||||
|
||||
```sh
|
||||
|
||||
export GOROOT=${HOME}/bin/go
|
||||
export GOPATH=${HOME}/go
|
||||
export PATH=${HOME}/bin/go/bin:${GOPATH}/bin:$PATH
|
||||
|
||||
```
|
||||
|
||||
##### Source the new enviornment
|
||||
|
||||
```sh
|
||||
|
||||
$ source ~/.bashrc
|
||||
|
||||
```
|
||||
|
||||
##### Testing it all
|
||||
|
||||
```sh
|
||||
|
||||
$ go env
|
||||
|
||||
```
|
||||
|
||||
## OS X (Yosemite) 10.10
|
||||
|
||||
### Build Dependencies
|
||||
|
||||
This installation document assumes OS X Yosemite 10.10+ on x86-64 platform.
|
||||
|
||||
##### Install brew
|
||||
|
||||
```sh
|
||||
|
||||
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||
|
||||
```
|
||||
|
||||
##### Install Git, Python
|
||||
|
||||
```sh
|
||||
|
||||
$ brew install git python
|
||||
|
||||
```
|
||||
|
||||
##### Install Go 1.6+
|
||||
|
||||
Install golang binaries using `brew`
|
||||
|
||||
```sh
|
||||
|
||||
$ brew install go
|
||||
$ mkdir -p $HOME/go
|
||||
|
||||
```
|
||||
|
||||
##### Setup GOROOT and GOPATH
|
||||
|
||||
Add the following exports to your ``~/.bash_profile``. Environment variable GOROOT specifies the location of your golang binaries
|
||||
and GOPATH specifies the location of your project workspace.
|
||||
|
||||
```sh
|
||||
|
||||
export GOPATH=${HOME}/go
|
||||
export GOVERSION=$(brew list go | head -n 1 | cut -d '/' -f 6)
|
||||
export GOROOT=$(brew --prefix)/Cellar/go/${GOVERSION}/libexec
|
||||
export PATH=${GOPATH}/bin:$PATH
|
||||
|
||||
```
|
||||
|
||||
##### Source the new enviornment
|
||||
|
||||
```sh
|
||||
|
||||
$ source ~/.bash_profile
|
||||
|
||||
```
|
||||
|
||||
##### Testing it all
|
||||
|
||||
```sh
|
||||
|
||||
$ go env
|
||||
|
||||
```
|
||||
|
Reference in New Issue
Block a user