Can anyone recommend (and link to) some non-trivial, open-source web applications or web API examples written in Go? I’m looking for examples that talk to external services or databases.
What do I mean by non-trivial? Most frameworks and libraries provide short examples, but many do not show anything beyond one or two files.
Open source examples are hard to find, so if you have a project that you are willing to share (without any secrets in your repo), please share them here.
As an aside, this talk by Kathy Sierra is an inspiration for this question: https://www.youtube.com/watch?v=FKTxC9pl-WM The thesis is that we learn by “pattern recognition”, so repeated exposure to non-trivial real-world examples is a must.
Here’s a work in progress project I am working on, it is not extensively documented, but probably you can get the hang of it from the code - https://github.com/go-neutrino/neutrino. Feel free to ask if you have questions.
I’ve been working on a simple news site (HN-like) posted earlier today:
I’m not sure I’d call it high quality but it has all the bits you’d expect in a web app like users, auth, views, models etc. and a command line tool to help with code generation, migrations, deployment etc. which might be familiar if you’ve used rails before for building sites. Also, a second for mattermost, which is a complete and polished app.
If learning, you might find it useful to pick one of the apps suggested above and try contributing to it, or have a look at some of the web app frameworks which are available - gorilla, revel, gin, etc. Those typically come with example apps as well and docs explaining their approach. Even if you don’t go all-in on a framework (you can certainly do a lot with the std lib) it can be useful to see how they have tackled certain problems like CSRF, form helpers, or sanitisation.