I've been trying to write my "go on rails" framework for years. I never quite got it like I wanted. There is gin and echo and all sorts of other frameworks and patterns but I finally found something I really like:
/foo/
/foo/bar/
/foo/bar/more/
That's it. Just three levels and all my controllers get passed in what's between the / with var names first, second, third.
In order to really make sure this framework could build something real I made a Hacker News clone. RemoteRenters.com is a HN just for articles about the remote work revolution since covid. Feel free to vote or submit to see how it all works!
Code is open source at: https://github.com/andrewarrow/feedback
1. Go has a major bottleneck and that’s the growth of its memory size when it’s under pressure. Templates bloat the memory quickly and make the site less performant at scale (aka if you put it on Heroku, you’d need more Dinos to support the traffic, which costs more.). Instead of GO templating, you can produce static pages and fill them up with JS Ajax or React, or whatever your front end flavor is and make that call a Go API you produce with the framework instead. This also helps you turn your site into an app if needed as well.
2. Saw somewhere you had database incremented user ids and other models? Not safe as it allows any bad actor to peruse your user base. Always do UUID as a scramble that can’t be iterated on.
Keep hammering. For everyone who says you don’t need a framework in Go, there are at least a few newbies who learn how to set up and run their Go server and stack from your framework.