T
T
tcLutin2021-10-29 19:04:49
go
tcLutin, 2021-10-29 19:04:49

Where is the best place to store global structures?

Where is the best place to store global structures in a project? At the root of the project? Or nevertheless to thrust in internal?
The structure is standard:
-cmd
-internal -> or is it better to put structures here?
-pkg
-go.mod
-go.sum
-server.go
-|user.go //structure
-|todo.go //structure

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Mamonov, 2021-10-29
@tcLutin

If we take the standard project structure, I would start from whether it makes sense to make this structure available. If yes, then I would look towards /pkg, if not /internal.
On a good note, I would make a separate package for this structure, and depending on whether it is used internally or not - I would put the package in /pkg or in /internal
What is your global structure used for?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question