New Web Framework for Go (Golang) Gains Momentum: What Developers Need to Know
The Go (Golang) ecosystem continues to evolve rapidly. While previously the choice of a web framework for Go almost always came down to the classic trio — Gin, Echo, and Fiber — a new player has now entered the scene, confidently carving out its niche. According to GitHub data and developer surveys from the last quarter, one of the next-generation frameworks is showing record growth in stars and contributors. We are talking about Huma (or, in an alternative version, Fuego — a framework focused on OpenAPI and code generation). Let's explore the reasons behind this surge of interest.
Why is the Go Community Looking for Something New?
Gin and Echo remain excellent solutions for a quick start, but they have fundamental limitations:
- Lack of strict route typing — parameters are often passed as strings, increasing the risk of runtime errors.
- Weak integration with OpenAPI/Swagger — generating documentation requires third-party tools (like swaggo), which are not always in sync with the code.
- Verbose validation — checking incoming data often requires writing redundant code.
The new framework solves these problems by offering a completely different approach based on declarative configuration and compile-time code generation.
Key Features of the New Framework (Using Huma and Fuego as Examples)
Although the projects are different, they share a common philosophy: "Write less, get more." The main features that attracted developers are:
- Zero-config OpenAPI: The framework automatically generates an OpenAPI 3.1 specification based on the signatures of your Go functions and data structures. You no longer need to write annotations in comments.
- Type-safe routing: Path parameters, query strings, and request bodies are checked by the Go compiler. If you change a data structure, the compiler will point out all inconsistencies in the routes before runtime.
- Built-in validation: Uses standard Go tags (validate) or custom validators. Validation errors are automatically wrapped into a correct HTTP response (400 Bad Request with a JSON error schema).
- Performance: Benchmarks show that the new framework is not inferior to Gin in speed, and in some scenarios (complex JSON serialization) it even surpasses it by using libraries like jsoniter or bytebufferpool.
Code Example: What It Looks Like in Practice
Compare: In Gin, you would write:
r.GET("/users/:id", func(c *gin.Context) { id := c.Param("id") // ... manual validation})In the new framework (Fuego/Huma syntax):
type GetUserParams struct { ID int `path:"id" validate:"required,min=1"`}huma.Get(api, "/users/{id}", func(ctx context