F
F
FedorWK2021-11-24 22:46:38
go
FedorWK, 2021-11-24 22:46:38

Where in the project structure should wrappers for third-party libraries and APIs be placed, what should they be called?

Carefully studied the recommended project structure in Go .
Couldn't figure out where wrapper packages for third-party libraries and APIs should be placed. In internal/pkg/ ? In tools/ ?

The second question is, are there any rules for naming such packages? If not rules, then good practices?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Tsvetkov, 2021-11-24
@yellow79

Recommended by whom? These are impostors, proof
. In fact, it doesn’t matter where you put the wrapper, you can in internal, you can in pkg, you can generally create a services folder and stuff all external dependencies there. No rules

E
Eugene, 2021-11-24
@udjin123

The internal folder has a clear and defined purpose, there should be internal packages that you don't want to be available to other projects. Read more here
Regarding the structure. Store anywhere and where it is convenient, the main thing is that the structure is logical. And in that repo, with the so-called recommended structure, there is no joke that this is not a recommended structure, and even more so, it has nothing to do with the standard, with which I personally agree.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question