A repo to play around with golang
-
Copy the download link from the official golang website https://go.dev/doc/install
-
Download the tarball e.g.
https://go.dev/dl/go1.20.linux-amd64.tar.gz
-
Delete prvious versions of the tarball and extract this new one
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.20.linux-amd64.tar.gz
-
Add Go binary to path
export PATH=$PATH:/usr/local/go/bin
-
Check that installation was successful
go version
-
go run hello.go
- executes the hello app -
go get <library-url>
- downloads the library -
go build .
- compiles the app using the current platform architecture; you can specify which platform to compile for (linux, windows, mac, etc) -
go mod tidy
- literally to tidy up; clears unused libraries