go-popular-libraries
Vetted, production-ready Golang libraries and frameworks for common tasks. Helps you choose the right tool for the job.
SKILL.mdskills/go/go-popular-libraries/SKILL.md
GitHubSelection Criteria
- Standard Library First — If
net/httporencoding/jsonis enough, don't add a dependency. - Maintenance Status — Only use libraries with recent commits and active issue management.
- Community Adoption — Favor well-known, battle-tested libraries over obscure ones.
- License — Ensure the license (typically MIT, Apache 2.0, or BSD) is compatible with your project.
- Zero Dependency — Libraries with few or no transitive dependencies are preferred.
Recommended Libraries by Category
Web / API
- Router:
chi,echo,gin, or standardnet/http(Go 1.22+). - Middleware:
chi/middleware. - Validation:
go-playground/validator.
Database
- PostgreSQL:
jackc/pgx(preferred overlib/pq). - SQL Helper:
sqlx,squirrel(query builder). - Migrations:
golang-migrate/migrate,pressly/goose. - Redis:
redis/go-redis.
Observability
- Logging:
log/slog(stdlib),rs/zerolog,uber-go/zap. - Metrics:
prometheus/client_golang. - Tracing:
go.opentelemetry.io/otel.
Testing
- Assertions:
stretchr/testify. - Mocking:
uber-go/mock(formerly gomock),vektra/mockery.
CLI & Config
- CLI:
spf13/cobra. - Config:
spf13/viper,caarlos0/env.
Utilities
- Functional:
samber/lo(the "lodash" for Go). - Errors:
samber/oops(contextual errors),pkg/errors(legacy). - Concurrency:
sourcegraph/conc.
Anti-patterns
- ❌ Using ORMs for everything — GORM is powerful but often hides performance issues. Use
sqlxorpgxfor better control. - ❌ Deep wrapping — Using a library that merely wraps a standard library function without adding significant value.
- ❌ Abandoned libraries — Check the last commit date before
go get. - ❌ Huge dependency trees — Be wary of "frameworks" that pull in hundreds of transitive dependencies.