Re: [go-nuts] Go Modules And Sub-Packages

2019-01-27 Thread thepudds1460
Assuming your repository is “github.com/user/package1”, your module is already on v3.1.9, you have a single go.mod file, and the go.mod file is in the root of the repository, then that would mean the first line in your go.mod file typically would be: module github.com/user/package1/v3 To impor

Re: [go-nuts] Go Modules And Sub-Packages

2019-01-27 Thread Kaveh Shahbazian
> > Honest question, what do you mean by sub-package? > I do not know what is the official phrase here. But to me the example is quite clear. To break it down further, assuming the module is at version 3.1.9, how should we import package2 inside package1? For example should the import path be

Re: [go-nuts] Go Modules And Sub-Packages

2019-01-27 Thread Jan Mercl
On Sun, Jan 27, 2019 at 9:07 PM Kaveh Shahbazian wrote: > How do you use Go modules with sub-packages? Honest question, what do you mean by sub-package? Given package import paths like, for example example.com/foo/bar/a and example.com/foo/bar/a/b package a is free to import

[go-nuts] Go Modules And Sub-Packages

2019-01-27 Thread Kaveh Shahbazian
How do you use Go modules with sub-packages? Do you use relative path for them? If you use *replace* directive in go.mod file, how do you manage the version? Example: .../github.com/user/package1 .../github.com/user/package1/package2 .../github.com/user/package1/package3 .../github.com/user/pack