Razzi's guide to go
go is a statically typed programming language that has high performance.
It’s created by one of the original authors of C, Ken Thompson.
One of the cool features is that it allows including all dependencies in a single executable.
So rather than having to install an entrypoint, then install dependencies, you can
This is visible in the official install instructions https://go.dev/doc/install
where they simply download a zipped go executable then put it on the path, and go is installed!
installation
Since I’m a debian user, I can apt install go like so:
$ sudo apt install golang
hello world
You can see the official hello world here.
Here’s the source you can put in a file like main.go:
package main
import "fmt"
func main() {
fmt.Println("HI")
}
And yes, that’s a literal tab character… you can see that this conforms to the official formatter by running go fmt on it.
Compile and run in command like so:
$ go run main.go
HI