A curated list of awesome libraries, tools, and resources for the Go programming language.
- Web Frameworks
- Database
- Command Line Interface (CLI)
- Configuration
- Logging
- Testing
- Security
- API and RPC
- Tooling
- Resources
- Gin - Arguably the most popular and widely used Go web framework. Although it has a Martini-like API, it is extremely fast thanks to its Radix tree-based routing. It has a large community and a rich ecosystem of middleware. It is one of the safest starting points for new projects.
- Fiber - A framework that is extremely easy and enjoyable to use, strongly inspired by Express.js from the Node.js world. It is built on top of
fasthttp
instead of Go's standardnet/http
package, making it one of the fastest web frameworks available. It is very easy to adapt for developers with Express experience. - Echo - Another popular high-performance, minimalist, and extensible framework. It features a powerful router, a rich set of middleware, and built-in support for template rendering. It is often mentioned alongside Gin and Fiber as one of the best minimalist frameworks.
- Chi - Stands out for being lightweight, idiomatic, and composable. The biggest advantage of
chi
is its full compatibility with Go's standardnet/http
package. This means you can use existingnet/http
-compatible middleware without any changes. It is one of the frameworks most faithful to Go's philosophy. - Gorilla/Mux - One of the oldest and most established routers in Go. It is more of a powerful router and dispatcher than a full-fledged framework. It forms the basis of many large and legacy projects. It is known for its flexible routing rules and robustness. Although it is now community-managed, it is still very common.
ORM and Database Tools
- GORM - A developer-friendly, full-featured ORM library for Go.
- SQLx - A general-purpose SQL extension for Go that extends the standard
database/sql
package. - ent - A simple yet powerful entity framework and ORM for Go.
- SQLBoiler - A lightning-fast ORM generator, tailor-made for you from your database schema.
- sqlc - Compile SQL to type-safe code
- FluentSQL - flexible and powerful SQL string builder
Database Drivers
- pgx (PostgreSQL) - A high-performance and full-featured driver and toolkit for PostgreSQL. It offers direct access to advanced PostgreSQL features (e.g., JSONB support) beyond the standard
database/sql
interface. It is the most recommended driver for modern projects. - go-sql-driver/mysql (MySQL) - The most popular, stable, and full-featured MySQL driver for Go's
database/sql
package. It forms the basis of almost all MySQL-based projects. - modernc.org/sqlite (SQLite) - A modern SQLite driver written in pure Go that does not require CGO. This feature makes cross-compilation extremely easy and eliminates external dependencies.
- mattn/go-sqlite3 (SQLite) - One of the oldest and most common
database/sql
-compatible drivers for SQLite3. It wraps the SQLite C library usingcgo
. - microsoft/go-mssql (Microsoft SQL Server) - The official
database/sql
-compatible driver for Microsoft SQL Server. - lib/pq (PostgreSQL) - A long-established PostgreSQL driver written in pure Go. Although it is in maintenance mode, it is still used in many projects.
- mongo-go-driver (MongoDB) - The official MongoDB driver for the Go language. It does not use the
database/sql
interface; it has its own rich and idiomatic API. - redis/go-redis (Redis) - The most popular, full-featured, and high-performance Redis client for Golang. It is the standard for interacting with this in-memory data store, which is also used as a database.
- gocql/gocql (Cassandra) - The most widely used Go driver for Apache Cassandra. It is highly configurable and performance-oriented.
- sijms/go-ora (Oracle) - A driver for Oracle Database written in pure Go. Its biggest advantage is that it does not require annoying external dependencies like an Oracle Instant Client installation.
- Cobra - A powerful library for creating modern Go CLI applications.
- urfave/cli - A simple, fast, and fun package for building command-line apps in Go.
- Bubble Tea - A Go framework for building terminal applications based on The Elm Architecture.
- ...add others here...
- Viper - The most powerful and full-featured configuration library in the Go ecosystem.
- Can read many file formats like JSON, YAML, TOML, .env, and Java properties.
- Automatically reads and binds environment variables.
- Can integrate command-line flags.
- Can perform live watching of configuration and reload changes.
- It is a "do-it-all" solution for almost all configuration needs.
- koanf - A modern, lightweight, and highly modular alternative to Viper.
- Reads from files, environment variables, or remote sources like
etcd
through configurable "providers." - Stands out with its flexible structure and clean API. It offers powerful features without the complexity of Viper.
- Reads from files, environment variables, or remote sources like
- godotenv - A very simple library that does one job very well: loading environment variables from
.env
files. It is often used to facilitate adherence to 12-factor app principles in development environments. - envconfig - Popular especially for containerized and cloud-native applications. It has a single purpose: to populate a Go struct directly from environment variables. It is very simple and effective to use.
- cleanenv - A configuration library that adopts "clean architecture" principles. It focuses on loading configuration from files and environment variables into a Go struct with clean and minimal code, using struct tags.
- Zap - A library for fast, structured, and leveled logging.
- Logrus - Structured and pluggable logging for Go.
- zerolog - A JSON logger that performs zero-allocation.
- Testify - The Swiss Army knife of the Go testing ecosystem. It is the most popular toolkit that enriches the standard
testing
package.assert
: A rich set of assertions that allow the test to continue even if it fails (assert.Equal(t, 1, 1)
).require
: An assertion set that stops the test immediately (t.Fatal
) when an assertion fails.suite
: Facilitates setup and teardown logic by grouping tests within structs.
- go-cmp - A library for safely comparing complex data structures (structs, slices, etc.) in tests. It stands out for being much safer and more configurable than
reflect.DeepEqual
. - testing - The foundation of everything. The core package that comes with the standard library, providing the ability to create sub-tests with
t.Run
, mark helper functions witht.Helper
, and offering basic test structures (*testing.T
). - GoMock - Developed by the Go team, this framework has become the standard for isolating dependencies in unit tests by generating mock implementations from interfaces. It automatically creates mocks with the
mockgen
tool. - gofakeit - An excellent library for programmatically generating tons of fake but realistic data for tests (names, addresses, UUIDs, credit card numbers, random texts, etc.).
- sqlmock - Allows creating a fake SQL driver when testing code that uses
database/sql
, without needing a real database connection. It is used to mock database interactions. - testcontainers-go - Indispensable for integration tests. It allows for programmatically creating Docker containers (PostgreSQL, Redis, Kafka, etc.) during tests and automatically destroying them when the test is finished.
- net/http/httptest - The standard library's basic package for testing HTTP handlers, which allows for creating fake HTTP requests and running in-memory servers.
- httpexpect - Built on top of
httptest
, this library allows for end-to-end testing of APIs with a fluent and BDD (Behavior-Driven Development) style syntax (Expect().Status(http.StatusOK).JSON().Object()...
).
- Built-in Fuzzing (
testing.F
) - Added to the standard library with Go 1.18, this is a powerful testing technique that automatically finds unexpected errors and edge cases by sending random inputs to a function. - Godog - Inspired by Cucumber, this is the most popular Behavior-Driven Development (BDD) framework for Go. It links test scenarios written in the
Given-When-Then
format to Go functions. - goleak - A tool that ensures the cleanliness of tests by checking if any goroutines have been leaked after the tests have finished, especially in concurrent programs.
- golang.org/x/crypto - Go's semi-standard cryptography library. The bcrypt package, in particular, is considered the industry standard for securely hashing passwords.
- golang-jwt/jwt - The most popular, full-featured library for creating, parsing, and validating JSON Web Tokens (JWT). It forms the basis of stateless authentication for APIs.
- casbin - An extremely powerful and flexible authorization library. It supports many access control models like ACL, RBAC, and ABAC, and makes it easy to manage "who can do what to which resource."
- oauth2 - Developed by the Go team, this is the core library for managing the client side of the OAuth 2.0 standard, used to implement features like "Sign in with Google/GitHub/Facebook."
- crypto/* - The set of packages in Go's standard library that provides all the basic building blocks for fundamental cryptographic operations (AES, RSA, SHA256, etc.).
- lego - A library written in pure Go, used to automatically obtain and renew SSL/TLS certificates from Let's Encrypt and other ACME-based certificate authorities. It's great for automating HTTPS.
- bluemonday - A powerful, policy-based HTML sanitizer used to clean user-submitted HTML input from malicious code (like XSS attacks).
- crypto/tls - The standard library's core package that enables HTTPS and other secure network communications.
- govulncheck - The Go team's official security tool. It scans your project's dependencies to detect packages with known vulnerabilities. It stands out by only reporting vulnerabilities that your code actually calls.
- gosec - A linting tool that statically analyzes Go source code to detect common security vulnerabilities like SQL injection, hardcoded credentials, and insecure blocks.
- mkcert - A simple tool for creating valid and trusted TLS certificates for local development environments (like
localhost
). It helps you get rid of browser warnings when developing with HTTPS.
- gRPC-go - The official implementation of gRPC for Go. A high-performance RPC framework based on HTTP/2, developed by Google.
- Gin - A very fast and popular HTTP web framework that uses Radix tree-based routing.
- Fiber - An easy-to-use and extremely fast web framework inspired by Express.js, built on
fasthttp
. - Echo - A high-performance, minimalist, and extensible web framework that offers powerful templating and middleware support.
- chi - A lightweight, idiomatic, and composable HTTP router that is fully compatible with
net/http
. - gorilla/mux - A powerful URL router and dispatcher for routing incoming requests to their target handlers. It has long been a cornerstone of the Go ecosystem.
- gqlgen - A library that has become the standard for building GraphQL servers by generating type-safe Go code from a GraphQL schema.
- Twirp - A Protobuf-based RPC framework developed by Twitch, which is simpler than gRPC and supports both JSON and Protobuf.
- gRPC-Gateway - A plugin that automatically generates a RESTful JSON proxy for your gRPC services. It allows you to serve both RPC and REST APIs from a single gRPC definition.
- Go-kit - A modular, composable programming toolkit for building distributed and robust microservices. It offers an architectural approach, not just a framework.
- go-zero - A full-featured framework for web and RPC, packed with code generation features. It is designed for high-concurrency scenarios.
- fasthttp - A high-performance alternative to the standard
net/http
. It forms the basis of many frameworks like Fiber and is used for APIs where speed is critical. - Hertz - An HTTP framework developed by Bytedance, focusing on high performance, extensibility, and ease of use.
- Goa - A framework that allows you to create APIs with a design-first approach. It generates code and documentation from your design.
- emicklei/go-restful - A library designed for creating RESTful web services, inspired by Java frameworks like JAX-RS and Spring Framework.
- Kratos - Developed by Bilibili, a microservice-oriented framework inspired by Go-kit, offering
gRPC
andHTTP
as standards. - gorilla/websocket - A full-featured and widely used WebSocket implementation for Go. It is indispensable for real-time APIs.
- rpcx - A high-performance, distributed, and pluggable RPC service framework, similar to Alibaba's Dubbo.
- kitex - A high-performance and extensible RPC framework developed by Bytedance, supporting Thrift and Protobuf.
- net/http - Go's standard library. It provides the fundamental building blocks for creating powerful, production-ready APIs without any external dependencies. All other libraries either wrap it or offer an alternative to it.
- golangci-lint - An extremely fast and configurable "meta" linter that brings dozens of different linters under one roof. It has become the industry standard for enforcing code standards in Go projects.
- gopls - The official Language Server Protocol implementation developed by the Go team. It provides features like auto-completion, go-to-definition, and real-time error analysis in editors like VS Code, GoLand, and Vim.
- gofmt - The tool that comes with Go's standard library, which automatically formats Go code according to the standard format.
goimports
is a superset ofgofmt
that also organizesimport
blocks. - gosec - A static analysis tool that scans Go source code to detect known security vulnerabilities and common mistakes.
- revive - A linter that is faster, more configurable, and more extensible than
golint
. It offers high performance, especially in CI/CD pipelines. - delve - The most popular and powerful full-featured debugger for the Go programming language.
- air - A live reload tool that automatically restarts the application when it detects a change in the code files. It incredibly speeds up the web development process.
- gops - A tool used to list currently running Go processes and get diagnostic information about them, such as memory and goroutines.
- testcontainers-go - A library that automates test environments by programmatically creating and managing Docker containers (PostgreSQL, Redis, Kafka, etc.) for integration tests.
- GoMock - A standard framework used to isolate dependencies in unit tests by generating mock implementations from interfaces.
- gofakeit - A library that makes it easy to generate random and fake data (name, address, credit card, etc.) for tests.
- goreleaser - A fantastic automation tool that compiles your Go projects for different operating systems and architectures, archives them, creates release notes, and publishes them to platforms like GitHub.
- gox - A simple, parallel-running cross-compilation tool for Go.
- swaggo/swag - A tool that automatically generates Swagger 2.0 / OpenAPI documentation from Go code comments.
- oapi-codegen - A tool that generates Go server boilerplate and client code from an OpenAPI 3 specification. Ideal for design-first APIs.
- wire - A compile-time dependency injection tool that is automatic and less prone to errors.
- go-callvis - A tool that interactively visualizes the call graph of your Go program. Useful for understanding large projects.
- pprof - A profiling tool included in Go's standard library, used to analyze the CPU and memory profiles of a running application. It is usually visualized with
go tool pprof
.
๐ Beginner and General Tutorials
- A Tour of Go โ An interactive tour of the Go language.
- Go by Example โ An introduction to the Go language with annotated examples.
- Go Cheat Sheet โ A reference card for the Go language.
- Go Tutorials โ JavaTpoint โ Basic Go language tutorial.
- Go Tutorials โ Tutorialspoint
- Learn Go in 7 Days โ Go for Node.js developers.
- 1000+ Exercises for Go โ Learn Go with exercises.
- Learn Go with Tests โ Learn Go with a TDD approach.
๐ง Web Development
- Build Web Application with Golang
- Building and Testing a REST API in Go with Gorilla Mux & PostgreSQL
- Building Go Web Applications and Microservices Using Gin
- How to Deploy a Go Web Application with Docker
- Simple Calculator with Go WebAssembly
- Go Examples 101
- Golang E-commerce Guide (Ponzu CMS)
๐๏ธ Database & Cache
- Go Database/SQL Tutorial
- Caching Slow Database Queries
- Canceling MySQL in Go
- dbq vs sqlx vs GORM Benchmark
๐ ๏ธ Advanced, Performance, Security
- Guide to Structured Logging in Go
- Scaling Go Applications
- Role-Based Access Control (RBAC) Authorization in Golang
- Behavior-Driven Development (BDD) with Godog
- Build your own Redis, Docker, Git, SQLite in Go! โ CodeCrafters hands-on tutorial.
๐ฎ Games and Graphics
- Game Development with Go โ Video series.
- Introduction to Go with WebAssembly
- Understanding Go Visually โ A visual tutorial for Go.
๐ฆ Architectures & Design Patterns
- Go Design Patterns
- Go-Clean-Template โ A clean architecture template.
- Hex Monscape โ An introduction to Hexagonal architecture.
- Go Patterns โ Commonly used structures and patterns.
๐จโ๐ป Learning Platforms
- YourBasic Go โ Comprehensive tutorials.
- Hackr.io Tutorial for Go โ The best tutorials selected by votes.
- FreeCodeCamp Tutorial for Golang
- Coursera: Programming with Google Go
๐งฉ Code Snippets & Examples
- Awesome Go @LibHunt - A primary resource for Go tools.
- Awesome Golang Workshops - A list of curated awesome Go workshops.
- Awesome Remote Jobs - A list of awesome remote work opportunities. Many are looking for Go developers.
- awesome-awesomeness - A list of other awesome lists.
- awesome-go-extra - Parses the awesome-go README file and generates a new README with repository information.
- Code with Mukesh - Blog posts from software engineer Mukesh.
- Coding Mystery - Solve escape room style programming puzzles using Go.
- CodinGame - Learn Go through interactive tasks by playing small games.
- Go Blog - The official Go blog.
- Go Code Club - A developer community that discusses a different Go project each week.
- Go Community (Hashnode) - The Gopher community on Hashnode.
- Go Forum - A discussion forum on the Go language.
- Go Projects - A list of projects in the Go community wiki.
- Go Proverbs - Go language proverbs compiled by Rob Pike.
- Go Report Card - An automatic quality assessment tool for your Go package.
- go.dev - The official hub for Go developers.
- gocryforhelp - A collection of Go projects that need help. A good starting point for contributing to the open-source world.
- Golang Developer Jobs - A platform that lists only Go-related job postings.
- Golang News - Links and news related to the Go language.
- Golang Nugget - A weekly summary of Go content delivered to your inbox every Monday.
- Golang Weekly - Projects, tutorials, and articles about Go every Monday.
- golang-nuts - The Go developer mailing list.
- Google Plus Community - The Google+ community for #golang fans (may no longer be active).
- Gopher Community Slack Chat - The Slack community for Gophers (learn how it came to be).
- Gophercises - Free Go coding exercises for beginners.
- json2go - An advanced JSON โ Go struct conversion tool.
- justforfunc - A YouTube channel on the Go language presented by Francesc Campoy (@francesc).
- Learn Go Programming - Learn Go concepts with visual explanations.
- Made with Golang - Discover projects made with Go.
- pkg.go.dev - The documentation center for open-source Go packages.
- studygolang - An active Go community based in China.
- Trending Go repositories on GitHub today - A great resource for discovering new Go libraries.
- TutorialEdge - Golang - Tutorial content on Golang.
๐ฅ Go for Developers of Other Languages
- Go Forum - The official forum for the Go community.
- Gophers Slack - The largest Slack channel for Go developers.
Your contributions and suggestions are always welcome! Please follow these steps:
- Fork this project.
- Create a new branch with a name like
feature/new-awesome-thing
. - Make your changes and Commit them (
git commit -m 'feat: Add a new awesome library'
). - Push your branch (
git push origin feature/new-awesome-thing
). - Open a Pull Request.
- Up A Reddit.