R
R
Roman Rakzin2016-09-24 18:46:45
go
Roman Rakzin, 2016-09-24 18:46:45

Packages in golang that are in other packages. How to organize the structure?

I decided to structure the code and divide it into packages.
It turned out that the Main package is divided into several files in the directory and contains `Package1.1` and this package also contains `Package 2.1` . As a result, errors are pouring in due to the fact that something is written incorrectly.
**Tell me examples with nested packages** located in the application itself (that is, not installed in a shared folder)
I include it like this `params "./Packages/Params/"`
The structure is something like this:

main.go (несколько файлов пакета main в одной папке)
    -Packages
    --PackagesGroup1
    ---package1.go
    ---SubPackagesGroup1
    ----subpackage1.go
    --PackagesGroup2
    ---package2.go

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question