HACKER Q&A
📣 umen

What GO web framework do you use?


Hello HN , what to use to be fast and easy like java's tomcat server ? So many half baked or not maintained frameworks... What do I use in production?


  👤 elt Accepted Answer ✓
I use the standard library. My entire business runs on it, html/css all through the standard library (templates package).

I use embed to embed all assets in the binary itself. "go build" and then "scp" the binary to the production server and "systemctl restart appserver"


👤 kgraves
I use Fiber [0] in production for a $4M ARR company and never had any issues even at peak traffic.

Took less than a month to start with and integrate and it is a joy to use.

[0] https://github.com/gofiber/fiber


👤 matthewmueller
For simple, battle-tested web server, you can't go wrong with net/http.

A couple of us are working on Bud (http://github.com/livebud/bud), which aims to be a full-stack web framework for Go, similar to Laravel or Rails.

The project is getting better very quickly! If you're working on a greenfield project and want more out of the box, I'd encourage you to give Bud a try!


👤 dcchambers
net/http. Go has great web support in the standard library.^1

Kidding aside, I didn't think that full-fledged web frameworks (akin to Ruby-on-Rails, Flask, Spring, etc) were really a thing with Go - or at least not a super popular thing. And you should be able to pretty easily recreate the functionality of a Tomcat-like web server using the http/net library.^2

[1]: https://pkg.go.dev/net/http [2]: https://go.dev/doc/articles/wiki/


👤 jamietanna
We've got a mix of a few but are recommending use of https://github.com/gorilla/mux due to it using the net/http interfaces and types, great performance and some configurability which can be handy.

In particular, my team is using it in conjunction with generated code https://deliveroo.engineering/2022/06/27/openapi-design-firs...


👤 karanbhangui

👤 tmaly
I have used Gin in the past and have really liked it.

👤 newusertoday
you can use standard library unlike other langauages golang has built in support for db[1], timer to schedule tasks[2], emails[3], templates[4] etc. and your application would be fairly upgrade proof. If you insist on using framework you can use echo or gofiber. There is also pockebase.io it uses echo internally but comes with user management etc. built in.

[1] https://pkg.go.dev/database/sql [2] https://pkg.go.dev/time [3] https://pkg.go.dev/net/smtp [4] https://pkg.go.dev/text/template [3]


👤 bgdkbtv
Why do most Go framework websites look like they were made by uni students for their side projects?

https://gin-gonic.com/

https://echo.labstack.com/

https://gobuffalo.io/

Compare that to Laravel for example: https://laravel.com/


👤 yashasolutions
Gin