Go Recipes
View CommandsGo toolchain commands for building, testing, and managing modules. Format code, run benchmarks, and handle dependencies.
8 recipes
Performance Benchmarks and pprof Profiling
Write benchmarks, generate CPU and memory profiles, and analyze performance bottlenecks with pprof.
Cross-Compile for Multiple OS/Arch Targets
Build Go binaries for Linux, macOS, and Windows across amd64 and arm64 architectures from a single machine.
Go Modules Dependency Workflow
Manage Go module dependencies including adding, updating, removing packages, and handling version conflicts.
Multi-Stage Docker Build for Go Binaries
Create a minimal Docker image for Go applications using multi-stage builds with scratch or distroless base images.
golangci-lint Setup with Custom Rules
Install and configure golangci-lint with a curated set of linters and custom rules for consistent code quality.
Initialize Go Module with Proper Structure
Set up a new Go project with module initialization, standard directory layout, and essential boilerplate files.
Build Releases with GoReleaser
Automate Go binary releases across platforms with GoReleaser, including changelogs, checksums, and GitHub releases.
Testing Workflow with Coverage Reports
Run Go tests with race detection, generate coverage reports, and visualize coverage in the browser.