sudo apt update && sudo apt dist-upgrade -y
sudo apt install golang-go -y
--> verify it is working
go version
--> create a directory for your program
mkdir go_app
cd go_app
--> enable dependency tracking for your code, you will need this for debugging
go mod init main
--> create your source code file
touch ./main.go
// Created by: Mr Coxall
// Created on: Sep 2020
//
// This program displays, "Hello, World!"
package main
import "fmt"
func main() {
// This function displays, "Hello, World!"
// the Go standard is to indent using "tabs" NOT spaces!
fmt.Println("Hello, World!")
fmt.Println("\nDone.")
}
go run ./main.go
fmt.Printf("The HST is: $%.2f.\n", tax)
gofmt -w ./main.go
# binary will be $(go env GOPATH)/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.1
golangci-lint --version
--> to lint your code
golangci-lint run ./*.go