This post was written on 23 August 2022, the libraries can change, be in maintenance mode etc.
When you choose a library in Go, pay attention to several points:
With these points you will have more or less an opinion on the reliability of this library.
Brings to the go community a complete suite of fully-featured, high-performance, API components to work with a Swagger API: server, client and data model.
The go-swagger focus with code generation is to produce idiomatic, fast go code, which plays nice with golint, go vet etc.
It will also do the parameter checks for you, such as enums, minimum for numbers etc.
Is a code generator for OpenAPI 3.0, it can generate server, client, models etc. For the server generator it can generate code for echo, chi, Gin and net/http.
Is an Express inspired web framework built on top of Fasthttp, the fastest HTTP engine for Go. Designed to ease things up for fast development with zero memory allocation and performance in mind.
Simplifies the creation of web applications and restful APIs. If you have Python experience, you may find the framework similar to Flask.
With the rise of fiber which does almost the same thing with better performance, echo has a slight drop in popularity. But it’s still a classic in Go.
Is a web framework written in Go. It features a martini-like API with performance that is up to 40 times faster thanks to httprouter.
With the rise of fiber which does almost the same thing with better performance, gin has a slight drop in popularity. But it’s still a classic in Go.
Generates Go structures and functions based on an SQL files containing create tables and alter.
Is a lightweight Go ORM for PostgreSQL, MySQL, MSSQL, and SQLite. Bun is a rewrite of go-pg.
go-pg is still maintained and there is no urgency in rewriting go-pg apps in Bun, but new projects should prefer Bun over go-pg. And once you are familiar with the updated API, you should be able to migrate a 80-100k lines go-pg app to Bun within a single day.
It is usually easier to write complex queries with Bun rather than GORM. Out of the box, Bun has better integration with database-specific functionality, for example, PostgreSQL arrays. Bun is also faster, partly because Bun is smaller in size and scope.
Bun does not support such popular GORM features like automatic migrations, optimizer/index/comment hints, and database resolver.
Is the official MongoDB supported driver for Go.
The zerolog package provides a fast and simple logger dedicated to JSON output.
Zerolog’s API is designed to provide both a great developer experience and stunning performance. Its unique chaining API allows zerolog to write JSON (or CBOR) log events by avoiding allocations and reflection.
Uber’s zap library pioneered this approach. Zerolog is taking this concept to the next level with a simpler to use API and even better performance.
Blazing fast, structured, leveled logging in Go.
Is a minimalistic configuration reader.
This is a simple configuration reading tool. It just does the following:
Viper is a complete configuration solution for Go applications including 12-Factor apps. It is designed to work within an application, and can handle all types of configuration needs and formats. It supports:
Viper can be thought of as a registry for all of your applications configuration needs.
List of awesome go tools: https://github.com/avelino/awesome-go