| This is 100% not how I write it. Only thing I agree on is putting all the paths in one file. In most other programming languages I've done a lot of research how to make it nice and clean. Was hoping this was it for Go because I'm cleaning up a big project. But my very basic no nonsense current setup seems better to me than this in many ways. If anybody has another example that is a lot better (and I don't mean complexer I don't have those ego issues), I am very interested. But this I want to hide as best as I can from my dev team this is all wrong. It's clever in a lot of ways but it's wrong. It does not have unit testing at all, all these tests would be duplicated in the end-to-end test. I also like end-to-end tests better but why put them here, way better to put them in postman for example then you have the most up to date documentation always auto-generated. Passing the config, man I had so many discussions with junior developers about this, don't do that you'll make things dependent on the config and cannot reuse them in other programs. But that was already mentioned a lot here. There are also a lot of functions with like 10 arguments passed. If you have that many arguments just pass a stuct containing a lot of the arguments it's always super confusing when people make functions with 12 arguments. I'm always counting them an after 14 times counting I rewrite their function. It's a matter of style so keep doing it this way if you like it, but it's not my style at all it makes no sense at all to me. If anybody knows a better example please tell me. |