Hacker News new | ask | show | jobs
by thinkingkong 1982 days ago
The stdlib is the best for clarity. But there are some excellent examples of how to structure projects depending on what you're trying to build. Mat Ryer gave an excellent talk on writing HTTP Services. If you want a good example on how to write distributed systems then Hashicorps' projects are more or less gorgeous.

https://medium.com/@matryer/how-i-write-go-http-services-aft...

https://github.com/hashicorp

2 comments

> Hashicorps' projects are more or less gorgeous

Is there a particular piece of code (as in, a single package/file/function) that jumps out to you as "gorgeous?" When I look at a random Hashicorp repo, it strikes me an impenetrable labyrinth.

Try to add a new feature or see how some feature works, with consul I did some greps over some features I used and followed the code.. was able to put a merge request upstream changing a behaviour I didn't like (configurable) within 4h (that didn't get accepted and that's OK)
To add to your point, Nic Jackson from hashicorp has a bunch of how-to videos and presentations that I've found good also.

https://www.youtube.com/channel/UC2V1SxXFUa5YxVJvTsrCgyg

He also wrote a book: https://www.packtpub.com/product/building-microservices-with...

The book might be good, but my copy had a problem with spurious characters in every code block, but that seems to be fixed in later printings.

Great resource! Thanks.