Reference : https://golang.org/
What is Go language?
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
How to set up host environment?
You can download installation binary file or you can building from source
Download Go distribution
https://golang.org/doc/install
Installing Go from source
https://golang.org/doc/install/source
I will install from source on Ubuntu 16.04 amd64(x86-64)
git clone https://go.googlesource.com/go
cd go
git checkout go1.8 or git checkout master ( I will use stable version go1.8 branch)
Try to install
I have got an error like this.
./all.bash ##### Building Go bootstrap tool. cmd/dist ERROR: Cannot find /home/jinseo/go1.4/bin/go. Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.
|
Resolve the issue
$ GOOS=linux GOARCH=amd64 ./bootstrap.bash
After made a soft link I ran again $ GOOS=linux GOARCH=amd64 ./bootstrap.bash ../../go-linux-amd64-bootstrap already exists; remove before continuing I deleted the directory $ rm -rf ../../go-linux-amd64-bootstrap/ Ran again $ GOOS=linux GOARCH=amd64 ./bootstrap.bash ...... Bootstrap toolchain for linux/amd64 installed in /home/jinseo/work/golang/go-linux-amd64-bootstrap. Building tbz. -rw-rw-r-- 1 jinseo jinseo 55474955 Mar 1 05:55 /home/jinseo/work/golang/go-linux-amd64-bootstrap.tbz Build was finished successfully. |
package main import "fmt" func main() { fmt.Printf("hello, world\n") }