Download Go Archive
Go 1.14 (February 2020)
| OS | Archive name |
|---|---|
| Windows | go1.14.windows-amd64.msi |
| Linux | go1.14.linux-amd64.tar.gz |
| Mac | go1.14.darwin-amd64-osx10.8.pkg |
| FreeBSD | go1.14.freebsd-amd64.tar.gz |
Installation
Download the archive and extract it into /usr/local, creating a Go tree in /usr/local/go. For example:
tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
Add /usr/local/go/bin to the PATH environment variable.
| OS | Output |
|---|---|
| Linux | export PATH = $PATH:/usr/local/go/bin |
| Mac | export PATH = $PATH:/usr/local/go/bin |
| FreeBSD | export PATH = $PATH:/usr/local/go/bin |
On Windows:
Create a go file named test.go in C:\>Go_WorkSpace.
File: test.go
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
Now run test.go to see the result −
C:\Go_WorkSpace>go run test.go
=> Output
Hello, World!