Hello ,
Sorry for such a simple question :
I am looking for a complex hello world example to illustrate a general module architecture and illustrate the maximum of situations :
- 4 packages , including packages at the same level and sub-packages
- 3 executables applications
appli_1.exe
appli_2.exe
appli_3.exe
The purpose of my question is to clearly understand the state of the art of import declaration in all the standard cases :
Q1) SUB_BRANCH ACCESS : import for accessing from Hello_from_a
a function in sub_package_a_aa or sub_package_a_bb
Q2) EXTRA BRANCH ACCESS : import from sub_package_a_bb
and call a function in sub_package_b
(in another branch)
Q3) organization for many executables
I tried ./cmd/appli_1/ appli_1.go
./cmd/appli_2/ appli_2.go
./cmd/appli_3/ appli_3.go
but I have difficulties to call ./package_a/sub_package_a_aa
functions
from ./cmd/appli_2/ appli_2.go
main executable
Structure ?:
./ cmd / appli_1 / appli1.go
./ cmd / appli_2 / appli2.go
./ cmd / appli_3 / appli3.go
. / package_a
file : package_a.go
with for example a function Hello_from_a()
. / package_a / sub_package_a_aa (example for sub_branch)
file : package_a_aa.go
with for example a function Hello_from_a_aa()
. / package_a / sub_package_a_bb (example2 for sub_branch)
file : package_a_bb.go
with for example a function Hello_from_a_bb()
. / package_b / (example for multiple branches)
file : package_b
with for example a function Hello_from_b()