Hacker News new | ask | show | jobs
by aliyfarah 1981 days ago
I recommend the Mattermost server:

https://github.com/mattermost/mattermost-server

And I disagree with those that say stdlib is the best way of looking at the best Go code for two reasons:

1. A lot of times stdlib code is restricted to use only backward compatible code with old API contracts, some parts are neat but others are unwieldy. It's a hit or miss.

2. Library code is different to application code. You can't get as much variety in style, abstractions, design patterns in stdlib as you can in a real world application.

I reckon it's important to read to get a whiff of succinct Go code, very good at learning protocols (like OAuth, Http etc) if you're interested, but won't be hugely helpful in building a CRUD app.

1 comments

This is one of the worst open source Go projects that exists, unfortunately.
Why do you say that? I found it extremely readable and is how I learnt Go in the first place. Curious to know your reasons though.
The documentation for package app kind of says it all:

https://pkg.go.dev/github.com/mattermost/mattermost-server/a...

This is atrocious stuff.