Looking for elegant code bases written in Golang
I am a Java developer with some Python experience. On my next project, I need to get hands-on with Golang quickly. So I would like to look at projects that have well-defined project structures, clean code, and tests. Also, any articles about coding style in Go would be highly appreciated.
6 comments
[ 3.3 ms ] story [ 31.6 ms ] threadThat's all you need. Tour go, and go by example.
Go is far from java. There aren't 10 ways to do things, it's not object oriented, and things like build tools, dependency management, formating, and tests are all baked into the core.
It's a relatively simple language that uses structs and relies heavily on the adapter pattern and composition. You should have no problem learning it quickly. Most go projects will look the same, have similar structure, and all will use the same formatting required by the compiler.
(I’m one of the authors.)
This project shows how to apply more complex patterns popular in business applications while staying true to the Go ideas, and not copying them blindly from Java.
In the Go community, you’ll often hear people say „just keep things simple” beats all patterns and is all you need. This may be true if you write a CLI tool or a small library, but if you have a team maintaining a big application, some patterns are super helpful.