Hi, I am an architect by profession and coded in java for eons long time back. learning golang. i think your layered package is not how we do in enterprise world. in the layered folder, the storage.go should ideally not be in models but in the storage package. this way model remains clean and doesnt know about persistence. in terms of heirarchy, the models are way at base, storage (or persistence layer) depends on models and the business logic (main,handlers) depend on storage and models. there is no cyclic dependency whatsover.
Hi, I am an architect by profession and coded in java for eons long time back. learning golang. i think your layered package is not how we do in enterprise world. in the layered folder, the storage.go should ideally not be in models but in the storage package. this way model remains clean and doesnt know about persistence. in terms of heirarchy, the models are way at base, storage (or persistence layer) depends on models and the business logic (main,handlers) depend on storage and models. there is no cyclic dependency whatsover.