(no title)
ayuhito | 11 months ago
And for the little that’s not, such as an ORM, there are many third party libraries available if you want to go down that path although it’s not necessary.
There’s nice things about a lot of these frameworks for sure, like ActiveRecord, but you usually just learn the patterns in Go and roll with it. The standard library has its own consistent style.
tredre3|11 months ago
That's a bold faced lie. In the list, the only things provided by Go are:
- routing: http.ServeMux has a router but until recently it was usually not used in real applications due to very limited capabilities (they finally added proper patterns in 1.22 which, in my view, finally makes it good enough).
- template: it's not even close to laravel's blade capabilities, but yes Go has good enough templating for most tasks.
ayuhito|11 months ago
net/http (even middlewares are just http.HandleFunc)
> database connections
We were using database/sql for the longest of times before switching to pgx since we wanted some convenience functions.
> email sending
net/mail gets you far enough unless you want to scale it.
> logging
log/slog (which is actually production grade compared to log/log)
> view template rendering
text/template, but I also think Laravel is a better choice if that’s your main focus.
Others either need an experimental standard library package (e.g. golang.org/x/crypto/argon2 for stuff like authentication) or finally need third party dependencies. DI is not enforced like other frameworks, but an extremely common pattern in Go.
At this point, do I really want to bring out a whole framework just for the last few requirements?