Simple example of nested Go modules, including incrementing to v2
This is a small demonstration repo related to golang/go#74016.
The latest contrib package documentation as rendered by pkg.go.dev can be viewed at:
The current basic repo structure (ignoring some auxillary files like go.sum):
.
├── go.mod // top-level module's go.mod file
├── root.go
└── contrib
├── contrib.go
├── nested1
│ ├── go.mod // a nested module's go.mod file
│ └── nested1.go
├── nested2
│ ├── go.mod // a nested module's go.mod file
│ └── nested2.go
└── nested3
├── go.mod // a nested module's go.mod file
└── nested3.go
- There was a single v0.9.0 module in this repo
- Then it was split into 4 total v1.0.0 modules in this repo:
- The top-level module:
module github.com/thepudds/nested-module-example- This was tagged
v1.0.0
- Three nested modules:
module github.com/thepudds/nested-module-example/contrib/nested1module github.com/thepudds/nested-module-example/contrib/nested2module github.com/thepudds/nested-module-example/contrib/nested3- These were tagged
contrib/nested1/v1.0.0and similar for nested2 and nested3
- The top-level module:
- Then the 4 modules were moved to v2.0.0
- The top-level module became:
module github.com/thepudds/nested-module-example/v2- This was tagged
v2.0.0
- The three nested modules became:
module github.com/thepudds/nested-module-example/contrib/nested1/v2module github.com/thepudds/nested-module-example/contrib/nested2/v2module github.com/thepudds/nested-module-example/contrib/nested3/v2- These were tagged
contrib/nested1/v2.0.0and similar for nested2 and nested3
- The top-level module became:
- Then the top-level module was moved to v2.0.2 with some example package doc links added to the contrib package.