Open
Conversation
See context package
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
mdelapenya
commented
Oct 28, 2024
* main: chore: use require.(No)Error(t,err) instead of t.Fatal(err) (testcontainers#2851)
stevenh
requested changes
Oct 28, 2024
|
|
||
| tcvenv | ||
|
|
||
| **/go.work |
Contributor
There was a problem hiding this comment.
question: do we want it committed or part of a setup process? Typically its not standard to add this, but I wonder if this is a good example for it?
| return Write(rootGoWorkFilePath, rootGoWork) | ||
| } | ||
|
|
||
| func newWorkFile(goWork *modfile.WorkFile, examples []string, modules []string) error { |
Contributor
There was a problem hiding this comment.
question: is the intent to exclude other modules like test, and wait? If not using a find for go.mod might be simpler.
Member
Author
There was a problem hiding this comment.
but wait is a package, not a module, right?
* main: chore: use require.Len instead of assert.Len (testcontainers#2854) chore: bump ryuk to 0.11.0 (testcontainers#2853) chore: enable usestdlibvars linter (testcontainers#2850) fix(compose): container initialisation (testcontainers#2844) fix!: data races (testcontainers#2843) fix: mongodb replicaset should work with auth (testcontainers#2847)
This reverts commit e4b8d22.
* main: chore: use require instead of t.Fatal (testcontainers#2855)
Member
Author
|
@mmorel-35 pinging you for a review (if possible), as you worked in the modulegen a lot 🙏 |
mmorel-35
reviewed
Nov 1, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR adds support for creating a go.work file and managing it when new modules are created using the
modulegentool.During this process, we had to rework a bit this code generation tool, using the
modfilepackage to handle the workfile programatically.Besides that, we updated the existing tests to check the work files are properly generated, also moving tests to the right package and even
removing duplicated tests (e.g. for validation).
Finally, we are improving the error messages, following recent patterns we are adopting in the library.
Important to notice the amount of lines in the changeset comes from running
go work sync, which updated all the dependencies.Why is it important?
Now the go toolchain will be able to handle the core module and its submodules in a proper manner, so it would be much easier to setup the IDE when working on the project.
In the past, we generated code for VSCode and handle all the submodules, now it would be possible to just open the root dir, and because of the existence of the
go.workfile,the IDE would be able to follow all links across the entire code base.
Related issues