Index
Quick Reference Guide
Essential Commands
| Command | Purpose |
|---|---|
go run main.go |
Compile and run |
go build |
Build binary |
go test ./... |
Run tests |
go mod tidy |
Sync dependencies |
go fmt ./... |
Format code |
go vet ./... |
Check for issues |
Common Patterns
| Pattern | Chapter |
|---|---|
| Error handling | Ch 33 |
| Table-driven tests | Ch 38 |
| Options pattern | Ch 58 |
| Worker pool | Ch 40 |
| Context cancellation | Ch 43 |
Type Reference
| Type | Zero Value |
|---|---|
bool |
false |
int |
0 |
string |
"" |
pointer |
nil |
slice |
nil |
map |
nil |
Key Packages
| Package | Purpose |
|---|---|
fmt |
Formatted I/O |
io |
I/O interfaces |
os |
OS operations |
net/http |
HTTP client/server |
encoding/json |
JSON encoding |
sync |
Synchronization |
context |
Cancellation |
testing |
Test framework |
Resources
- go.dev - Official site
- pkg.go.dev - Package docs
- Go by Example
- Effective Go