Golang
Docs
- builtin.go - predeclared identifiers
Main Template
package main import ( "fmt" "os" ) func main() { argsWithProg := os.Args argsWithoutProg := os.Args[1:] fmt.Println(argsWithProg) fmt.Println(argsWithoutProg) }
Modules
- pkg.go.dev/std - standard
go mod …
- use
go mod ...for dependencies
Managing Dependencies
go mod tidy # list deps of this module go list -m -u all
- use
CLI
Configuration
- https://github.com/spf13/viper - configuration
Containers
AWS
- https://github.com/Amnesic-Systems/veil - tool kit for networked services on AWS Nitro Enclaves (Isolated EC2)
Networking
Notebook
- https://github.com/gopherdata/gophernotes - Jupyter for Golang
Web
- https://github.com/gorilla/mux - HTTP router and URL matcher for building Go web servers
Templating
- code gen: stringer
Concurrency
# go routine go f(x, y, z) # channel ch := make(chan int, 10) // buffered ch <- v // Send v := <-ch // Receive
Sample App
People
- Steve Francia - Hugo creator. Utils like cobra and viper
# env
goenv
# get source
go get -u github.com/golang/dep/cmd/dep
go get github.com/vapor-ware/ksync/cmd/ksync