Golang
Cheatsheets
- https://www.codecademy.com/learn/learn-go/modules/learn-go-introduction/cheatsheet
- https://devhints.io/go
- https://quickref.me/go.html
Tutorials/Courses
Official
Free/Teaser
Commercial/Paid
The Hello World
With your choice of command line tool, enter your home directory.
bash
cd
# Windows legacy versions (before 11)
cd %HOMEPATH%Create a project folder for the trial.
bash
mkdir trial-golang
cd trial-golangInitiate the project module
bash
go mod init example/trial-golangbash
# Output
go: creating new go.mod: module example/trial-golangCreate a file names hello.go in the project folder. Paste the following codes into it, then save the file:
go
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}Run the code to view the output.
bash
go run .bash
# Output
Hello, World!