Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: go mod vendor does not produce a consistent modules.txt #28102
What did you do?
What did you expect to see?
I expected to see no differences.
What did you see instead?
There were many differences. Running
Different in what way? (Which modules were transposed, and does one of them transitively depend on the other?)
I tried to produce a test to reproduce this and I found a combination of user-failure/a potentially additional command as needed.
The reason why I got the failure is because as part of CI, we were doing this:
When I copy vendor to another directory, it becomes part of the current project in some way and it starts resolving all of the vendored dependencies as if they were part of the current project. So I think my initial issue is wrong as that's user failure.
But, the reason why we do that is because in our CI, the place where we run that doesn't have git. We commit our vendor directory and we want to ensure our vendor directory is correctly committed. Our CI doesn't have git at this point, so I copied the vendor directory to contain it. It doesn't appear like there's a way to validate the vendor directory similar to
Am I missing a command or should I create a separate issue for that?