|
I like fiber the most, but can use anything like echo (and past companies use only httprouter, gin, httpkit, etc) as long as the codebase not overly layered, I guess any framework is fine only need to split to 3 kind of layer: 1. serialization/transport layer (codegenerated) -- framework goes here 2. business logic layer (one that unit tested), only input struct, transform/process, and output struct (DTOs) 3. persistence/3rd party layer (codegenerated too), add additional go source code file for things that wasteful to be codegenerated, only input struct, basic persistence methods or network calls, and output struct (DAOs) goes here if using gRPC layer 1 already codegenerated, so only need to fill layer 2 with business logic and codegenerating layer 3. |
Problem is, many MANY people do not have sufficient experience to know the perils of putting the framework in charge of the architecture, so they do just that, and decry any other approach as "Java-esque." (That label says an awful lot in and of itself.) The impact of this choice often doesn't become apparent until much farther down the road. Then you start getting into the weird cottage industry involving brittle hacks with DBs/frameworks in order to delay setting them up so that you can run unit tests in under ten minutes.
It's ridiculous.
Part of the blame lies with the devs: refusing to take responsibility for your architecture means you are at the whim of the framework. And the framework devs are also at fault for pushing the lie that you merely need to write the absolute bare minimum of code and everything else will be taken care of.