sudo apt install golang
mkdir $HOME/programming/go
mkdir $HOME/programming/go/bin
mkdir $HOME/programming/go/pkg
mkdir $HOME/programming/go/src
export GOPATH=$HOME/go
mkdir -p $GOPATH/src/github.com/methsaan
The 'hello' program:
mkdir -p $GOPATH/src/github.com/methsaan/hello
cat $GOPATH/src/github.com/methsaan/hello/hello.go
```
package main
import "fmt"
func main() {
fmt.Println("Today is the 1st of January, 2019, first program")
}
```
Option 1
go install github.com/methsaan/hello
Option 2
cd $GOPATH/src/github.com/methsaan/hello
go install
which hello
cd $GOPATH/bin/hello
./hello
To run locally, without creating binary
cd $GOPATH/src/github.com/methsaan/hello
go run hello.go