Advice for writing enterprise-level API in Go?

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

InfluxDB - Purpose built for real-time analytics at any scale.
InfluxDB Platform is powered by columnar analytics, optimized for cost-efficient storage, and built with open data standards.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • viper

    Go configuration with fangs

    For configs, given you haven't mentioned what sort of configs - I'd generally recommend viper.

  • InfluxDB

    Purpose built for real-time analytics at any scale. InfluxDB Platform is powered by columnar analytics, optimized for cost-efficient storage, and built with open data standards.

    InfluxDB logo
  • Testify

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

    I haven't needed to use anything outside the standard library for testing - the only exception to this being testify, which I use for the easy assert.Equal and other wrappers most of the time.

  • node-config

    Node.js Application Configuration

    How do I handle configs? In our Node APIs we use this config package, which allows us to override default configs on a per-environment basis. What's the standard way of doing this in Go?

  • zerolog

    Zero Allocation JSON Logger

    For #2 I use zerolog, which logs as JSON lines, but gives you considerable control over the output. The standard package is fine if you just want regular ol' text logs, however

  • zap

    Blazing fast, structured, leveled logging in Go.

    I use zap for logging. With some planning, you can easily switch between logging to JSON or Plaintext (the former is faster but less readable). Though, that comes with a learning curve - you'll have to spend some time reading the docs before you can actually start using zap in production. On the other hand, logrus is pretty simple to use, but relatively quite slow (this might not matter for personal projects, but probably will in production). And of course, there's the standard package as well! Take your pick ;)

  • logrus

    Structured, pluggable logging for Go.

    I use zap for logging. With some planning, you can easily switch between logging to JSON or Plaintext (the former is faster but less readable). Though, that comes with a learning curve - you'll have to spend some time reading the docs before you can actually start using zap in production. On the other hand, logrus is pretty simple to use, but relatively quite slow (this might not matter for personal projects, but probably will in production). And of course, there's the standard package as well! Take your pick ;)

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

  • Go 1.21 Released

    7 projects | news.ycombinator.com | 8 Aug 2023
  • slogx - slog package extensions and middlewares

    3 projects | /r/golang | 1 May 2023
  • What is the common log library which is industry standard that is used in server applications?

    5 projects | /r/golang | 21 Mar 2023
  • Should we be sanitizing log messages?

    3 projects | /r/golang | 14 Dec 2021
  • My opinionated way to write and test a go http server

    3 projects | dev.to | 4 May 2021