Generated banner for Golang Popular Libraries
Generated logo for Golang Popular Libraries

Golang Popular Libraries

Samuel BertheCommunityCreated by samberDistributed by Samuel Berthe

  • Skill
  • Guidelines
  • Software development
  • MIT
  • No issues found

From the author

Golang library and framework selection — vetted production-ready options by category (web, database, testing, logging, messaging), new and experimental stdlib packages, standard-library-first tradeoffs, and maturity signals (maintenance, license, importer counts). Apply when the user asks for library suggestions, wants to compare alternatives, needs to choose a library for a specific task, or when a new dependency is being added to the project. Not for a specific library's API once chosen (→ See that library's dedicated skill, e.g. `samber/cc-skills-golang@golang-samber-lo`), nor for go.mod mechanics, upgrades, or vulnerability audits (→ See `samber/cc-skills-golang@golang-dependency-management` skill).
— the description by samber

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a curated, expert-led approach to selecting Go libraries and frameworks. It emphasizes a 'standard library first' philosophy, ensuring that developers only introduce external dependencies when necessary. It offers a vetted catalog of production-ready options across common categories like web, database, and testing, while providing clear criteria for assessing maturity, maintenance, and performance. The skill acts as a decision-making framework to help developers avoid over-engineering and dependency bloat.

What it does

  • Recommends vetted, production-ready Go libraries by category.
  • Promotes the use of the Go standard library and official golang.org/x extensions.
  • Provides criteria for evaluating library maturity, including maintenance and community adoption.
  • Helps developers compare alternative libraries for specific tasks.
  • Advises on when to avoid external dependencies to keep projects simple and maintainable.

When to use it

  • When you need to choose a library for a new task or feature.
  • When you are evaluating alternatives for an existing dependency.
  • When you want to know if the standard library can solve a specific problem.
  • When you are adding a new dependency and want to ensure it is production-ready.

Advantages

  • Reduces dependency bloat by prioritizing standard library solutions.
  • Ensures selection of mature, well-maintained, and performant code.
  • Provides a consistent, idiomatic approach to Go project architecture.
  • Helps mitigate risks associated with abandoned or unmaintained packages.

Usage examples

“What is the best library for building a REST API in Go?”
The agent will provide a comparison of popular frameworks like Gin, Echo, and Chi, highlighting their strengths and suggesting the best fit based on your specific performance or simplicity requirements.
“Should I use an external library for structured logging?”
The agent will explain the capabilities of the standard library's log/slog package and advise whether it meets your needs or if an external library is required for advanced features.
“I need a database ORM. What are my options?”
The agent will list vetted options like GORM, SQLx, or Ent, explaining the trade-offs between reflection-based ORMs and code-generation tools like sqlc.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/samber/golang-popular-libraries/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip golang-popular-libraries.zip -d .agents/skills

Documentation by samber

Persona: You are a Go ecosystem expert. You know the library landscape well enough to recommend the simplest production-ready option — and to tell the developer when the standard library is already enough.

Go Libraries and Frameworks Recommendations

Core Philosophy

When recommending libraries, prioritize:

  1. Production-readiness - Mature, well-maintained libraries with active communities

  2. Simplicity - Go's philosophy favors simple, idiomatic solutions

  3. Performance - Libraries that leverage Go's strengths (concurrency, compiled performance)

  4. Standard Library First - SHOULD prefer stdlib when it covers the use case; only recommend external libs when they provide clear value

Reference Catalogs

Find more libraries here: https://github.com/avelino/awesome-go

This skill is not exhaustive — refer to library documentation and code examples for more information:

  • When exploring a candidate library, → See samber/cc-skills-golang@golang-pkg-go-dev skill (godig) for docs, symbols, versions, importers, and known vulnerabilities — prefer it over Context7 for Go package facts.

  • Once a candidate is added to your build, → See samber/cc-skills-golang@golang-gopls skill (gopls) to browse its actual resolved source and compare candidates side by side.

  • Context7 remains a fallback for docs not indexed on pkg.go.dev.

General Guidelines

When recommending libraries:

  1. Assess requirements first - Understand the use case, performance needs, and constraints

  2. Check standard library - Always consider if stdlib can solve the problem

  3. Prioritize maturity - MUST check maintenance status, license, and community adoption before recommending. Use a module's imported-by count on pkg.go.dev as a popularity and indirect quality signal — widely-imported libraries are more battle-tested and have stronger backward-compatibility pressure; → See samber/cc-skills-golang@golang-pkg-go-dev skill to count importers and compare alternatives

  4. Consider complexity - Simpler solutions are usually better in Go

  5. Think about dependencies - More dependencies = more attack surface and maintenance burden

Remember: The best library is often no library at all. Go's standard library is excellent and sufficient for many use cases.

Anti-Patterns to Avoid

  • Over-engineering simple problems with complex libraries

  • Using libraries that wrap standard library functionality without adding value

  • Abandoned or unmaintained libraries: ask the developer before recommending these

  • Suggesting libraries with large dependency footprints for simple needs

  • Ignoring standard library alternatives

Cross-References

  • → See samber/cc-skills-golang@golang-dependency-management skill for adding, auditing, and managing dependencies

  • → See samber/cc-skills-golang@golang-pkg-go-dev skill to vet a candidate library on pkg.go.dev — versions, importers, licenses, and known vulnerabilities — before adopting it

  • → See samber/cc-skills-golang@golang-samber-do skill for samber/do dependency injection details

  • → See samber/cc-skills-golang@golang-samber-hot skill for samber/hot in-memory caching details

  • → See samber/cc-skills-golang@golang-samber-oops skill for samber/oops error handling details

  • → See samber/cc-skills-golang@golang-stretchr-testify skill for testify testing details

  • → See samber/cc-skills-golang@golang-grpc skill for gRPC implementation details

Files

references/libraries.md

Top Go Libraries by Category

Table of Contents

  • Web Frameworks

  • HTTP Clients

  • ORM & Database

  • Database Drivers

  • Testing

  • Command Line and Configuration

  • Logging

  • Validation

  • JSON Processing

  • Authentication & Authorization

  • Caching

  • Rate Limiting

  • Concurrency & Goroutines

  • Messaging

  • Types and Data Structures

  • Database Schema Migration

  • WebSockets

  • gRPC

  • GraphQL

  • File Watching

  • Retry Logic

  • Error Handling

  • Metrics & Monitoring

  • API Documentation

  • Dependency Injection

  • Functional Programming & Utilities

  • Excel & Spreadsheet

Web Frameworks

Gin (https://github.com/gin-gonic/gin) High-performance HTTP web framework with minimalist API. Up to 40x faster than some alternatives. Great for building REST APIs and microservices.

Echo (https://github.com/labstack/echo) Minimalist, extensible web framework. Clean middleware system, excellent performance. Good for both REST APIs and traditional web apps.

Fiber (https://github.com/gofiber/fiber) Express.js-inspired web framework built on Fasthttp. Very fast, easy for Node.js developers transitioning to Go.

Chi (https://github.com/go-chi/chi) Lightweight, idiomatic router that composes well with net/http. Minimal dependencies, great for smaller projects.

HTTP Clients

Resty (https://github.com/go-resty/resty) Simple HTTP and REST client for Go. Inspired by Ruby's rest-client. Great for API consumption with retry support.

Req (https://github.com/imroc/req) Simple Go HTTP client with "black magic" - less code, more efficiency. Clean API for common operations.

ORM & Database

GORM (https://github.com/go-gorm/gorm) Feature-complete ORM library. Developer-friendly, supports associations, hooks, auto-migrations. The most popular Go ORM.

SQLx (https://github.com/jmoiron/sqlx) Extensions for database/sql that provide convenience while maintaining power. Type-safe, performant query helpers.

Ent (https://github.com/ent/ent) Entity framework for Go. Code-generated, type-safe ORM with excellent support for complex queries and graph traversals.

Sqlc (https://github.com/sqlc-dev/sqlc) Generate type-safe Go code from SQL. No runtime reflection, compiler-checked queries.

Database Drivers

go-sql-driver/mysql (https://github.com/go-sql-driver/mysql) MySQL driver for Go's database/sql package. Maintained by the Go team, reliable and performant.

lib/pq (https://github.com/lib/pq) Pure Go PostgreSQL driver. The gold standard for PostgreSQL in Go.

pgx (https://github.com/jackc/pgx) PostgreSQL driver with advanced features. Faster than lib/pq, supports all PostgreSQL types.

redis-go (https://github.com/redis/go-redis) Redis client for Go. Cluster support, modern Redis features, well-maintained.

mongo-go-driver (https://github.com/mongodb/mongo-go-driver) Official MongoDB driver for Go. Supports async operations, transactions (in newer versions).

Testing

Testify (https://github.com/stretchr/testify) Sacred extension to the testing package. Assertions, mocking, suite testing. Essential for Go testing.

gomock (https://github.com/uber-go/mock) Mocking framework for Go interfaces. Widely used, integrates well with testing package.

go-sqlmock (https://github.com/DATA-DOG/go-sqlmock) SQL mock driver for testing database operations. Test database code without a real database.

testcontainers-go (https://golang.testcontainers.org) Integration testing with real dependencies in Docker containers. Spin up databases, message queues, etc.

httptest (standard library) Testing HTTP servers/clients. Built into Go, no external dependency needed.

Command Line and Configuration

Cobra (https://github.com/spf13/cobra) Commander for modern Go CLI applications. Powerful subcommand system, flags, auto-generated docs. Industry standard for CLIs.

Viper (https://github.com/spf13/viper) Go configuration with fangs. Works with Cobra, supports multiple formats (JSON, YAML, TOML, env).

urfave/cli (https://github.com/urfave/cli) Simple, fast, fun package for building command line apps. Alternative to Cobra.

Koanf (https://github.com/knadh/koanf) Lightweight, extensible library for reading config. Support for JSON, YAML, TOML, env, command line.

env (from https://github.com/caarlos0/env) Parse environment variables into Go structs with defaults. Simple, type-safe, no struct tags.

Logging

Zap (https://github.com/uber-go/zap) Fast, structured, leveled logging. Uber's production logger, zero-allocation in hot paths.

Zerolog (https://github.com/rs/zerolog) Zero-allocation JSON logging. Very fast, simple API, leveled logging.

Logrus (https://github.com/sirupsen/logrus) Structured logger for Go. Mature, widely-used, plugin architecture. Note: deprecated in favor of structured logging.

Validation

validator (https://github.com/go-playground/validator) Go struct validation. Tags-based, extensive validators, cross-field validation.

ozzo-validation (https://github.com/go-ozzo/ozzo-validation) Fast validation library. Modern alternative for struct validation.

JSON Processing

jsoniter (https://github.com/json-iterator/go) High-performance 100% compatible drop-in replacement for encoding/json. Faster JSON parsing.

Authentication & Authorization

Casbin (https://github.com/casbin/casbin) Authorization library supporting ACL, RBAC, ABAC. Policy-based access control.

JWT (https://github.com/golang-jwt/jwt) JSON Web Token implementation for Go. Full-featured, widely-used.

Caching

hot (https://github.com/samber/hot) In-memory caching library for Go with 9 eviction algorithms (LRU, LFU, TinyLFU, W-TinyLFU, S3FIFO, ARC, TwoQueue, SIEVE, FIFO), TTL, loaders with singleflight deduplication, sharding, and stale-while-revalidate.

Ristretto (https://github.com/dgraph-io/ristretto) High-performance memory-bound Go cache.

BigCache (https://github.com/allegro/bigcache) Efficient key/value cache for gigabytes of data. Sharded, optimized for high throughput.

go-cache (https://github.com/patrickmn/go-cache) In-memory key-value store with expiration. Thread-safe, simple API.

Rate Limiting

Tollbooth (https://github.com/ulule/limiter) Rate limiting HTTP middleware. Simple, volume-based limiting, easy to use.

golang.org/x/time/rate (https://golang.org/x/time/rate) Standard library rate limiter. Token bucket algorithm, well-maintained.

Concurrency & Goroutines

Watermill (https://github.com/ThreeDotsLabs/watermill) Event-driven framework for Go. Message streams, event sourcing, CQRS patterns.

ro (https://github.com/samber/ro) Reactive programming for Go. Event-driven streams with operators for data flow transformation.

Messaging

franz-go (https://github.com/twmb/franz-go) Kafka client for Go. Modern, high-performance, feature-complete client with excellent documentation and community support.

amqp091-go (https://github.com/rabbitmq/amqp091-go) Official RabbitMQ client for Go. Maintained by RabbitMQ team, supports AMQP 0.9.1 protocol.

NATS.go (https://github.com/nats-io/nats.go) Client for NATS messaging system. Simple, secure, performant communications.

Temporal Go SDK (https://github.com/temporalio/sdk-go) Durable execution framework for building reliable async applications. Workflows, activities, and long-running processes.

DBOS (https://github.com/dbos-inc/dbos-transact-golang) Backend framework for Go applications with durable execution, built on PostgreSQL.

Types and Data Structures

gods (https://github.com/emirpasic/gods) Go Data Structures - Sets, Lists, Stacks, Maps, Trees, Queues, and much more

bloom (https://github.com/bits-and-blooms/bloom) Bloom filter implementation. Memory-efficient set membership testing.

hyperloglog (https://github.com/clarkduvall/hyperloglog) HyperLogLog implementation for Go. Memory-efficient cardinality estimation for large datasets.

Carbon (https://github.com/uniplaces/carbon) Simple, semantic time library for Go. Time parsing, formatting, manipulation.

google/uuid (https://github.com/google/uuid) Generate and parse UUIDs. Official Google library, RFC 4122 compliant. For new Go 1.27+ code, check the standard library uuid package first — this library still has broader RFC-variant coverage (v3/v5 namespaced UUIDs).

Database Schema Migration

golang-migrate (https://github.com/golang-migrate/migrate) Database migration tool. Supports multiple databases, version control for schemas.

goose (https://github.com/pressly/goose) Database migration tool. SQL or Go migrations, supports multiple databases.

WebSockets

gorilla/websocket (https://github.com/gorilla/websocket) WebSocket package for Go. Mature, widely-used, part of Gorilla toolkit.

gRPC

grpc-go (https://github.com/grpc/grpc-go) The Go language implementation of gRPC. HTTP/2 based RPC framework by Google.

GraphQL

gqlgen (https://github.com/99designs/gqlgen) Go generate based graphql server library. Type-safe, schema-first, code generation.

graphql-go (https://github.com/graphql-go/graphql) Implementation of GraphQL for Go. Query execution, schema parsing.

File Watching

fsnotify (https://github.com/fsnotify/fsnotify) Cross-platform file system watcher for Go. Watch for file changes efficiently.

Retry Logic

avast/retry-go (https://github.com/avast/retry-go) Retry mechanism for Go with exponential backoff. Simple, configurable.

Error Handling

pkg/errors (https://github.com/pkg/errors) Legacy projects only. Prefer stdlib errors, fmt.Errorf("%w"), and errors.Join for new code; use a structured error library only when you need stack traces or rich context.

oops (https://github.com/samber/oops) Error handling library with stack traces, hints, and context. Rich error wrapping with type-safe error chains.

Metrics & Monitoring

prometheus/client_golang (https://github.com/prometheus/client_golang) Prometheus instrumentation library for Go. Metrics, histograms, counters, gauges.

opentelemetry-go (https://github.com/open-telemetry/opentelemetry-go) OpenTelemetry Go API and SDK. Distributed tracing, metrics, logs.

API Documentation

swag (https://github.com/swaggo/swag) Auto-generate OpenAPI/Swagger specs from Go code annotations, parsing comment-based annotations (@Summary, @Param, @Success, @Router, etc.) on handler functions to produce swagger.json/swagger.yaml. Integrates with Gin (gin-swagger), Echo (echo-swagger), Fiber (fiber-swagger), Chi, and net/http, with Swagger 2.0 and OpenAPI 3.x output.

Dependency Injection

do (https://github.com/samber/do) Dependency injection library for Go. Simple, runtime DI with service locator pattern and health checks.

Wire (https://github.com/google/wire) Code-generated dependency injection for Go. Compile-time dependency injection without reflection.

Dig (https://github.com/uber-go/dig) Dependency injection container for Go. Runtime DI with lifecycle management.

Fx (https://github.com/uber-go/fx) Application framework for Go. Built on Dig, provides lifecycle management, dependency injection, and observability.

Functional Programming & Utilities

lo (https://github.com/samber/lo) A generics-based helper library for Go. Slice, map, and tuple operations with functional programming style.

mo (https://github.com/samber/mo) Monads and functional programming helpers for Go. Option, Either, Try, and other functional patterns.

Excel & Spreadsheet

Excelize (https://github.com/qax-os/excelize) Go library for reading and writing Excel files (XLSX). Supports formatting, charts, and complex spreadsheet operations.

Requirements and compatibility

Written for: Claude Code, OpenAI Codex

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Declares allowed tools, Claude Code frontmatter

The author says: Designed for Claude Code, Codex or similar harness, and for projects using Golang.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
samber
Publisher
Samuel Berthe (Community)
Distributed by
Samuel Berthe
Source
samber/cc-skills-golang · skills/golang-popular-libraries · commit bb1d43d
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by samber or Samuel Berthe.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download golang-popular-libraries.zip