Modules can contains multiple packages (https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more).
So all the packages listed in the tree above can be contained within a single module (go.mod) defined at the top most level. To take a random example of this, take a look at https://github.com/rogpeppe/go-internal. The module github.com/rogpeppe/go-internal contains multiple packages: github.com/rogpeppe/go-internal/cache github.com/rogpeppe/go-internal/cmd/testscript github.com/rogpeppe/go-internal/cmd/txtar-addmod github.com/rogpeppe/go-internal/cmd/txtar-goproxy github.com/rogpeppe/go-internal/cmd/txtar-savedir ... The tags for releases using this top-level approach are then simple: https://github.com/rogpeppe/go-internal/tags As covered in the Background (https://github.com/go-modules-by-example/index/blob/master/009_submodules/README.md#background) it's highly likely this setup will suit all your needs, but please ask back here in case you come across a situation that you think is not covered. On Sat, 9 Mar 2019 at 08:42, Abhishek Sudhakaran <itzura...@gmail.com> wrote: > > not required, the service must be able to import bll/* and possibly other sub > packages. > > On Saturday, March 9, 2019 at 2:31:48 AM UTC+5:30, Paul Jolly wrote: >> >> (full disclosure, I wrote >> https://github.com/go-modules-by-example/index/blob/master/009_submodules/README.md) >> >> Quick first question: are you absolutely sure you need multiple modules? >> >> https://github.com/golang/go/wiki/Modules#faqs--multi-module-repositories >> >> On Fri, 8 Mar 2019 at 20:49, Abhishek Sudhakaran <itzu...@gmail.com> wrote: >> > >> > Trying to make modules work for the below project structure >> > >> > . >> > ├── bll >> > │ ├── billing >> > │ │ ├── details.go >> > │ │ └── go.mod >> > │ ├── complaint >> > │ │ ├── details.go >> > │ │ └── go.mod >> > │ └── task >> > │ ├── details.go >> > │ └── go.mod >> > ├── go.mod >> > └── services >> > ├── billing >> > │ ├── go.mod >> > │ └── main.go >> > ├── complaint >> > │ ├── go.mod >> > │ └── main.go >> > └── task >> > ├── go.mod >> > └── main.go >> > >> > >> > Already tried solutions for a similar question : >> > >> > https://github.com/go-modules-by-example/index/tree/master/009_submodules >> > https://roberto.selbach.ca/intro-to-go-modules/ >> > >> > if the modues are nested as above, how does the git tag(s) change ??? >> > tried bll/task/v0.1.1 and task/v0.1.1 etc. did not work. >> > >> > error is like: >> > >> > cannot find module providing package github.com/{name}/{repo}/bll/task >> > >> > should bll/go.mod services/go.mod be there ? (tried that also , didn't >> > work) >> > >> > I have seen examples for single level directories, but not for nested ones. >> > >> > Can you please point out what I am missing ? >> > >> > Thanks. >> > >> > -- >> > You received this message because you are subscribed to the Google Groups >> > "golang-nuts" group. >> > To unsubscribe from this group and stop receiving emails from it, send an >> > email to golang-nuts...@googlegroups.com. >> > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.