Should I use frameworks in Go?
We all know that Go is one of the popular programming languages for crafting fast and scalable web applications. If you are coming from another programming languages (such as JavaScript or PHP), you might prefer using frameworks to make everything easier for yourself. But to be honest, we don't need that in Go.
Why the heck not?

Enjoy my crap drawing LOL
When you have two frameworks, they both force you to fill in a specific hole. Usually, there is no way to fit one framework inside another. With packages, the situation is different. You are in control, so go crazy!
How do I handle URL parameters and methods?
While Go's net/http package is comprehensive, the one thing it truly sucks at is handling URL parameters and providing an easy way to create handlers for specific methods. But hey, that is not the case anymore!
In Go 1.22, Go team introduced two enhancements to the net/http package: method matching and wildcards. Yay!
Instead of writing this verbose code:
m := http.NewServeMux()
m.HandleFunc("/items/", func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet {
w.WriteHeader(http.StatusMethodNotAllowed)
return
}
if r.URL.Path == "/items/" {
w.WriteHeader(http.StatusNotFound)
return
}
w.Write([]byte(strings.TrimPrefix(r.URL.Path, "/items/")))
})
You will get this pretty code instead :)
m := http.NewServeMux()
m.HandleFunc("GET /items/{id}", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(r.PathValue("id")))
})
I heard that X is faster, so why shouldn't I learn it?!
Fiber (based on FastHTTP), and many other alternatives, have numerous tradeoffs that make it hard for people to recommend their usage.
You are locked into their ecosystem, as there is no standard library compatibility.
Too much magic involved to gain speed that no one will ever notice.
To get the full benefits, you will be forced to write in an unidiomatic and advanced style of Go.
Summary (TL;DR)
Go has a comprehensive standard library that takes care of almost everything necessary for the vast majority of web applications. If you have a choice, it is unnecessary to use a framework just to build an API service.