basics
package main
import "fmt"
func main() {
fmt.Println("0x1RIS")
}
Output:
0x1RIS
Run it
go run .
go build .
go vet ./...
run compiles and executes
build writes a binary
vet catches suspicious constructs before they become bugs
go.mod
module verify
go 1.22
A module is the unit of dependency management
The go line sets the language version for the files in it
Formatting
gofmt is not optional
Run it before reading your own code in review
Go 1.27 includes a gofmt alignment fix, so expect small whitespace changes after upgrading
Next
Types and methods in 02 types
Posted