-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run tests/build with go work off to catch more problems #9170
Comments
It's not documented officially at the moment, AFAIK. The best discussion I'm aware of happens on golang/go#53502 - discussing the various use cases people have of committing I'll try to get some topic experts' opinions on this |
Testing with
Ideally, a project like |
Unfortunately, we don't yet have a good story for how to structure the “seen from outside” tests for pre-commit testing. (golang/go#28835 proposes one such mechanism, but it's not clear whether there is a better alternative.) One option for post-commit testing is to create an external module, use That might look something like: https://go.dev/play/p/3GuBSk1lP0p. |
The root repo has a
go.work
file, which will mask such issues. This is the reason why having ago.work
file committed is considered dangerous; when it's committed, it's worth at least running the tests withGOWORK=off
to catch such issues.You can try to run all tests in this repo with
GOWORK=off
in CI - this may uncover surprises :)Originally posted by @eliben in #9168 (comment)
The text was updated successfully, but these errors were encountered: