What are your favorite packages to use?

This page summarizes the projects mentioned and recommended in the original post on /r/golang

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. chi

    lightweight, idiomatic and composable router for building Go HTTP services

    https://github.com/derision-test/go-mockgen for the best mocks Ive ever had in Go https://github.com/go-chi/chi for HTTP routing

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. logrus

    Structured, pluggable logging for Go.

    logrus for logging. It's slower than zerolog but I've been used it for so long, so if performance doesn't really matter (e.g. simple CLI) I still prefer to use it.

  4. zerolog

    Zero Allocation JSON Logger

    logrus and, more recently, zerolog for logging

  5. spew

    Implements a deep pretty printer for Go data structures to aid in debugging

    go-spew : Really helpful to pretty print user defined data structures, makes debugging a lot easier.

  6. Gin

    Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.

    This has been fixed in Gin v1.7.2.

  7. pgx

    PostgreSQL driver and toolkit for Go

    Here is link number 1 - Previous text "PGX"

  8. go-json

    Fast JSON encoder/decoder compatible with encoding/json for Go

    go-json for encoding/decoding

  9. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  10. aconfig

    Simple, useful and opinionated config loader.

  11. urfave/cli

    A simple, fast, and fun package for building command line apps in Go (by urfave)

  12. pggen

    Generate type-safe Go for any Postgres query. If Postgres can run the query, pggen can generate code for it.

    Agree with your choices, except go-json which I never tried. pggen is fantastic. Love that library. The underlying driver, pgx, is also really well written.

  13. go-mockgen

    https://github.com/derision-test/go-mockgen for the best mocks Ive ever had in Go https://github.com/go-chi/chi for HTTP routing

  14. sqlf

    sqlf generates parameterized SQL statements in Go, sprintf style

    https://github.com/keegancsmith/sqlf for building parameterized SQL queries

  15. protoactor-go

    Proto Actor - Ultra fast distributed actors for Go, C# and Java/Kotlin

    https://github.com/AsynkronIT/protoactor-go for actor model framework (situational)

  16. GJSON

    Get JSON values quickly - JSON parser for Go

    I love https://github.com/tidwall/gjson and https://github.com/tidwall/sjson for fast and frictionless json reading and editing. It makes life so much easier for cases where you don't want to model a tree of nightmare-ish API responses, like Elasticsearch.

  17. sjson

    Set JSON values very quickly in Go

    I love https://github.com/tidwall/gjson and https://github.com/tidwall/sjson for fast and frictionless json reading and editing. It makes life so much easier for cases where you don't want to model a tree of nightmare-ish API responses, like Elasticsearch.

  18. go-sdk

    Discontinued A composable toolbox of libraries to build everything from CLIs to enterprise applications. (by blend)

    This is probably not popular approach on here, but we maintain a public version of our internal go monorepo sdk package as an open source repo on github: https://github.com/blend/go-sdk, and I'll use this for personal stuff as well.

  19. errors

    Discontinued Simple error handling primitives

    https://github.com/pkg/errors is a must-have prior to the Go2 error proposals landing.

  20. godotenv

    A Go port of Ruby's dotenv library (Loads environment variables from .env files)

    https://github.com/joho/godotenv for loading env vars from a file gets used a lot here.

  21. httprouter

    A high performance HTTP request router that scales well

    httprouter for routing. Several years ago (5 years ago maybe) when I started using Go, I always tried to use the best and fastest packages and this package boasts itself as the fastest router for Go. Fast forward to today, I'm not sure if it still the fastest around, but it's stable and I've never had issues with it, so I keep using it.

  22. Testify

    A toolkit with common assertions and mocks that plays nicely with the standard library

    testify for testing. I like it since it make the testing codes shorter and tidy.

  23. cobra

    A Commander for modern Go CLI interactions

    cobra for CLI. It's easy to use and I've been using it for so long I don't have any plan to change it.

  24. sqlx

    general purpose extensions to golang's database/sql

    sqlx which make working with database painless. It's really vital for my job since as an ordinary developer my jobs often revolved on creating CRUD apps. It also uses SQL query, so I don't have to learn any ORMs.

  25. decimal

    Arbitrary-precision fixed-point decimal numbers in Go

    decimal, one of the first Go library that created to work with decimal and monetary value.

  26. qamel

    Simple QML binding for Go

    qamel, simple QML binding for Go. Before pandemic I often use it for creating simple GUI apps for my clients or friends. It's features are limited, only works for Windows and Linux (though there is PR for ARM devices which I haven't able to check) but it's good enough for my case.

  27. dom

    Package for access and manipulate DOM element in HTML file (by go-shiori)

    dom, package for manipulating HTML document with APIs that kinda similar with DOM manipulation in JS. I use it whenever I need to scrape data from websites.

  28. dbgen

    Discontinued Generate database code from SQL files, using sqlx as its base library

    dbgen, a simple package for generating database codes for MySQL and MariaDB. As I said before, my job mostly on CRUDs and it's quite a pain to write database codes in Go using sqlx as its base. For each database operation I need to do at least three operations:

  29. koanf

    Simple, extremely lightweight, extensible, configuration management library for Go. Supports JSON, TOML, YAML, env, command line, file, S3 etc. Alternative to viper.

    https://github.com/knadh/koanf for config management. Readme contains why it's a good alternative to viper.

  30. ulid

    Universally Unique Lexicographically Sortable Identifier (ULID) in Go

    oklog/ulid to generate IDs. coreos/go-oidc for validating JWTs I get from auth. google/go-cmp for comparing structs in tests (unless the project is already using Testify). spf13/pflag because life's too short for Go's flag handling. getkin/kin-openapi for validating reqests/responses against my OpenAPI spec (in tests).

  31. go-oidc

    A Go OpenID Connect client.

    oklog/ulid to generate IDs. coreos/go-oidc for validating JWTs I get from auth. google/go-cmp for comparing structs in tests (unless the project is already using Testify). spf13/pflag because life's too short for Go's flag handling. getkin/kin-openapi for validating reqests/responses against my OpenAPI spec (in tests).

  32. go-cmp

    Package for comparing Go values in tests

    oklog/ulid to generate IDs. coreos/go-oidc for validating JWTs I get from auth. google/go-cmp for comparing structs in tests (unless the project is already using Testify). spf13/pflag because life's too short for Go's flag handling. getkin/kin-openapi for validating reqests/responses against my OpenAPI spec (in tests).

  33. pflag

    Drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.

    oklog/ulid to generate IDs. coreos/go-oidc for validating JWTs I get from auth. google/go-cmp for comparing structs in tests (unless the project is already using Testify). spf13/pflag because life's too short for Go's flag handling. getkin/kin-openapi for validating reqests/responses against my OpenAPI spec (in tests).

  34. kin-openapi

    OpenAPI 3.0 (and Swagger v2) implementation for Go (parsing, converting, validation, and more)

    oklog/ulid to generate IDs. coreos/go-oidc for validating JWTs I get from auth. google/go-cmp for comparing structs in tests (unless the project is already using Testify). spf13/pflag because life's too short for Go's flag handling. getkin/kin-openapi for validating reqests/responses against my OpenAPI spec (in tests).

  35. gogo-factory

    Are there people seek a fixture replacement package like factory_bot (a ruby gem)? I build a similar package (gogo-factory). It is helpful to setup test data.

  36. migrate

    Database migrations. CLI and Golang library.

    For my simple case i just wrote the migrations as queries in my test code. But I'm pretty sure you could use go-migrate for that

  37. swag

    Automatically generate RESTful API documentation with Swagger 2.0 for Go.

    Swag Swagger doc generator

  38. zap

    Blazing fast, structured, leveled logging in Go.

    Zap Levelled logging

  39. ginkgo

    A Modern Testing Framework for Go

    Ginkgo Behavioural test framework

  40. jsoniter

    A high-performance 100% compatible drop-in replacement of "encoding/json" (by json-iterator)

    jsoniter for low level access to JSON encode and decode

  41. Task

    A task runner / simpler Make alternative written in Go

    Go Task A simple task runner which is cleaner IMHO than using Makefiles (opinionated but works for me)

  42. goreman

    foreman clone written in go language

    Goreman A handy little process runner I find useful for various things

  43. direnv

    unclutter your .profile

    Direnv Very useful for maintaining environments per directory

  44. athens

    A Go module datastore and proxy (by gomods)

    Athens A self hosted Go module proxy which has saved our asses more than once.

  45. bqb

    BQB is a lightweight and easy to use query builder that works with sqlite, mysql, mariadb, postgres, and others.

    bqb for query building. Used to use squirrel, but performance and complexity lead me to make bqb.

  46. gqlgen

    go generate based graphql server library

    gqlgen for GraphQL services. After trying several packages, gqlgen has been the most stable and easy to use.

  47. gopherjs

    A compiler from Go to JavaScript for running Go code in a browser

    gopherjs has been great with a personal experiment to implement a virtual dom framework within Go.

  48. go-formatter

    A curated list of awesome Go frameworks, libraries and software

    Also recommend the Awesome Go list.

  49. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • My next client wants to redevelop a java Webapp with go

    13 projects | /r/golang | 21 Apr 2022
  • Lumber: A simple and pretty logger for Golang

    6 projects | /r/golang | 24 Sep 2021
  • How do I test my knowledge?

    4 projects | /r/golang | 23 Jul 2021
  • Backstage Software Templates

    5 projects | dev.to | 13 Apr 2021
  • Decoding JSON sum types in Go without panicking

    3 projects | news.ycombinator.com | 15 Mar 2025

Did you know that Go is
the 4th most popular programming language
based on number of references?