modulegen: create internal/module and internal/modfile#1539
modulegen: create internal/module and internal/modfile#1539mdelapenya merged 1 commit intotestcontainers:mainfrom mmorel-35:modulegen/module
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
mdelapenya
left a comment
There was a problem hiding this comment.
Cool, thanks! This LGTM and it's ready to be merged 👏 I myself understand the code but anybody else in the community could not understand the rationale behind the usage of gomod Vs keeping the template. BTW this is cool!
I'd appreciate if you use the PR template to include a description of what this PR does (technical implementation) and why is needed (product needs), because I see PR descriptions as a way of documentation for these two personas: a community member, and the future ourselves in the need to check why we did something in such a way in the past.
So I'd ask you for filling in the PR description before merging it 🙏
|
Ok @mdelapenya , |
Signed-off-by: Matthieu MOREL <[email protected]>
|
Kudos, SonarCloud Quality Gate passed!
|
Now it's perfect. Thanks for your hard work improving the module generator 🚀 |
|
You're welcome ;) ! There was a typo in some names "mode" instead of "mod" was used. That's why I updated the code. |
* main: modulegen: create internal/module and internal/modfile (testcontainers#1539)
* main: modulegen: generate md file inside internal/mkdocs (testcontainers#1543) modulegen: create internal/module and internal/modfile (testcontainers#1539)
* main: (32 commits) fix: remove wrong example from workspace (testcontainers#1556) chore(deps): bump the all group in /modules/localstack with 1 update (testcontainers#1552) modulegen: generate code-workspace with json marshal (testcontainers#1551) chore(deps): bump the all group in /modules/compose with 2 updates (testcontainers#1553) feat: add mariadb module (testcontainers#1548) feat(modulegen): print out VSCode workspace file if needed (testcontainers#1549) modulegen: generate md file inside internal/mkdocs (testcontainers#1543) modulegen: create internal/module and internal/modfile (testcontainers#1539) [Enhancement]: add ability to set repo:tag for ContainerRequest FromDockerfile (testcontainers#1508) Fix module generator for examples (testcontainers#1545) Update pulsar.md (testcontainers#1542) modulegen: create internal/make (testcontainers#1537) chore: fix workflow (testcontainers#1538) chore(deps): bump the all group in /examples/cockroachdb with 1 update (testcontainers#1522) chore(deps): bump the all group in /examples/bigtable with 1 update (testcontainers#1534) chore(deps): bump the all group in /modules/localstack with 4 updates (testcontainers#1535) chore(deps): bump the all group in /modules/k3s with 2 updates (testcontainers#1526) chore(deps): bump the all group in /examples/spanner with 2 updates (testcontainers#1532) chore(deps): bump the all group in /examples/firestore with 1 update (testcontainers#1523) chore(deps): bump the all group in /modules/redis with 1 update (testcontainers#1524) ...








What does this PR do?
This PR move the logic of go.mod construction from main package to internal/modfile package.
It also replaces the use of a template to the use of golang.org/x/mod library. This allows to read the go version and the main package informations from the main go.mod and use it to construct the new module.
As there is no more template for go.mod, the script for updating go version is updated too.
It also moves the construction of example.go and example_test.go to internal/module.
As the testcontainer-go version is directly retrieved from mkdocs.yml this property is not provided as an Example property.
Why is it important?
This is separating code in there domain to improve the readability and maintanability.
Related issues
Follow-ups