- Go version: 1.22.2
- Create a module using
go mod init <module_name>
- Create executables by running
go build
in the root directory of the project. - Create executables in a different directory
go build -o <path>/<executable_name>
- Running
go fmt ./...
before compiling fixes common formatting issue../...
tells to apply the command in the current directory and all the subdirectories. go vet ./...
catches syntactically valid but incorrect codes.
- Writing Hello World