-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/go: go mod vendor should ignore README, CONTRIBUTING and any other non metadata file is part of a subdirectory of the module #27337
Comments
Is there anything I can do to weigh in and getting a decision? I'm happy to deal with the patch in 2 parts (the README/CONTRIBUTINGS) and a second part for everything starting with |
I'm a little confused about the report, but it sounds like what is being requested is:
The files that are copied now are the ones that may be legally required to copy the code (basically, copyright notices and supporting files). There is no attempt to make the vendored copy useful in any other way, such as by copying READMEs etc. The assumption is that people who want to look at the code will look at an original copy, not the trimmed copy in a vendor directory. I think the copy set should be left alone. |
@rsc: sorry, I may have not been clear enough. We are saying the same thing.
For instance, after running
As soon as some files like those are in a subdirectory of the module itself, it's getting copied. Edit: rephrased bug title to better match intent |
@alandonovan: I didn't hear more from @rsc or anyone from the Go team on that since my last replied. I'm still happy to implement this as needed, after a ack for the team. |
What version of Go are you using (
go version
)?go version go1.11 linux/amd64
Does this issue reproduce with the latest release?
go mod vendor
has been introduced with 1.11What operating system and processor architecture are you using (
go env
)?What did you do?
I run
go mod vendor
, experimenting to remove vendor/ directory from my repo, but still using it for building ubuntu packages in our build system which is offline when building.What did you expect to see/What did you see instead?
I saw a lot of files are filtered like AUTHORS, LICENSE from my go dependencies, also main packages like in
cmd/
directories are as well skipped from the copy, which is great.However, I see that the vendor/ directory ships
README.md
,CONTRIBUTING.md
and a lot of metadata/vcs/build system file.gitignore
,.travis.yaml
. I don't think those files are a good fit for the vendor directory as this one is generated and not the source of documentation, readme or contributors guide.I'm happy proposing a PR on gerrit to add README/CONTRIBUTING prefixed files from
go mod vendor
if there is an agreement here. I'm a little bit unsure about the other ones though, like.gitignore
,.travis.yaml
as those aren't capitalized and quite extensive as per vcs and such. A good approach may be to skip any files in the root of the copied module directory starting with a "."?What do you think?
The text was updated successfully, but these errors were encountered: