Golang hello world
GO
Go (Golang) is a statically typed, compiled programming language designed at Google.
Mac Install
brew install go
Hello World
Create your workspace directory $HOME/go
. Then make the directory src/hello
inside your
workspace. Inside it create file hello.go
with
package main
import "fmt"
func main() {
fmt.Printf("Hello World!")
}
Then build it with
cd ~/go/src/hello
go build
and run it with
./hello
Updated: 2019-12-20