-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
Cannot go mod tidy
on repo with generated files
#34514
Comments
Generated code should be committed in the repo. That's the recommended practice. |
The |
Duplicate of #26626 |
Why do the tests of a dependency matter to my repository when building or tidying repos? |
@jpopadak, please read the two issue threads linked above. |
What version of Go are you using (
go version
)?go version go1.13 darwin/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Run the associated
makefile
then rungo mod tidy
Directory Layout:
makefile
internal/tools.go
go.mod
go.sum
runner.go
runner_test.go
What did you expect to see?
Dependencies removed from
go.sum
and cleaned up.What did you see instead?
go mod tidy
seems to be trying to validate that a generated package exists.However, (1) we do not use that package directly in our code, but the a test on which a dependency of ours uses is throwing the error. (2) none of our code directly calls to any of the
_test
files or packages of our dependency. Actually, I dont even think one can reference a test package from a dependency.The text was updated successfully, but these errors were encountered: