What are the most useful packages you know for Go?

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

Our great sponsors
  • Scout APM - Less time debugging, more time building
  • SonarQube - Static code analysis for 29 languages.
  • OPS - Build and Run Open Source Unikernels
  • chi

    lightweight, idiomatic and composable router for building Go HTTP services

    https://github.com/go-chi/chi - when net/http is not enough this is the router I use. gorilla/mux is slow, didn't bother trying anything else after chi.

  • go-formatter

    A curated list of awesome Go frameworks, libraries and software

    It depends on what you would like to do with Go, but good starting points could be https://awesomeopensource.com/projects/go and may have a look at https://github.com/avelino/awesome-go .

  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.

  • zerolog

    Zero Allocation JSON Logger

    https://github.com/rs/zerolog - one of the best structural logging library

  • websocket

    Minimal and idiomatic WebSocket library for Go (by nhooyr)

    https://github.com/nhooyr/websocket - websocket implementation. Recently migrated to it from gorilla/websocket. Nicer API and faster but nothing really wrong with gorilla. Just wanted to try something new.

  • pgx

    PostgreSQL driver and toolkit for Go

    https://github.com/jackc/pgx - excellent library for Postgre. Especially if you need PSQL specific features

  • goqu

    SQL builder and query library for golang

    github.com/doug-martin/goqu - SQL query builder. Don't like ORMs in general, didn't like GORM. The API is a bit verbose but it does the job and supports tons of SQL features including database specific ones.

  • errors

    Simple error handling primitives

    github.com/pkg/errors - don't like how wrapping is done in standard library. This is better. Been using this library forever and it's even compatible with recent standard library changes.

  • SonarQube

    Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.

  • Testify

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

    github.com/stretchr/testify - very useful for tests

  • 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.

    https://github.com/gin-gonic/gin - My goto framework for writing microservices

  • gomock

    GoMock is a mocking framework for the Go programming language. (by golang)

    https://github.com/golang/mock - Auto generate mocks from interfaces for unit testing

  • gonum

    Gonum is a set of numeric libraries for the Go programming language. It contains libraries for matrices, statistics, optimization, and more

    https://github.com/gonum/gonum - Contains almost everything one needs for numerical analysis. The guys over there are porting LAPACK to pure Go with explicit tests.

  • requests

    HTTP requests for Gophers (by carlmjohnson)

  • sqlx

    general purpose extensions to golang's database/sql

    https://github.com/jmoiron/sqlx : Great extension of the standard database/sql package, but 100% compatible with it

  • multierrgroup

    Because I like hashicorp's multierror, I created https://github.com/andrewstuart/multierrgroup which basically provides the same API but returns all errors encountered, if any.

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