- pkg.go.dev: Go package registry
- Tutorials
go mod init
: initializes and writes a newgo.mod
file in the current directorygo mod edit
: edits and formatsgo.mod
files, for use primarily by tools and scriptsgo mod tidy
: ensures that thego.mod
file matches the source code in the modulego test -v
: executes test functions (whose names begin withTest
) in test files (whose names end with_test.go
)go build
: compiles the packages, along with the dependencies but it doesn't install the build result.go install
: compiles and installs the packagesgo env -w GOBIN=/path/to/your/bin
: changes the install target by setting theGOBIN
variable usinggo env
go work init <dir>
: creates ago.work
file for the workspace containing the modules in<dir>
directory
- Hello World: https://go.dev/doc/tutorial/getting-started
- Create a Go Module: https://go.dev/doc/tutorial/create-module
- Create a module
- Call your code from another module(
import
) - Return and handle an error(
errors
module) - Return a random greeting(slice:
[]string
, array:[3]string
) - Return greetings for multiple people(
map[<key-type>]<value-type>
) - Add a test(unit test)
- Compile and install the application
- Getting started with multi-module workspaces: https://go.dev/doc/tutorial/workspaces
- A Tour of Go - Basic: https://go.dev/tour/list
Basic Type: https://go.dev/tour/basics/1Flow Control: https://go.dev/tour/flowcontrol/1Advanced Type: https://go.dev/tour/moretypes/1
- A Tour of Go - Advanced
Method and interfaces: https://go.dev/tour/methods/1- Generics: https://go.dev/tour/generics/1
Concurrency: https://go.dev/tour/concurrency/1
- Go predefined data structure
- Go Web Framework - Gin: https://go.dev/doc/tutorial/web-service-gin
- the design of slice: https://go.dev/blog/slices-intro