Skip to content
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: do not update go.mod and go.sum with imports found in .gitignore #42763

Closed
mkungla opened this issue Nov 21, 2020 · 6 comments
Closed
Labels
FrozenDueToAge GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mkungla
Copy link
Contributor

mkungla commented Nov 21, 2020

go.mod and go.sum should not be updated from paths found in .gitignore which may contain resources or experimental code.

@ianlancetaylor ianlancetaylor changed the title Do not update go.mod and go.sum with imports found in .gitignore cmd/go: o not update go.mod and go.sum with imports found in .gitignore Nov 21, 2020
@ianlancetaylor ianlancetaylor changed the title cmd/go: o not update go.mod and go.sum with imports found in .gitignore cmd/go: do not update go.mod and go.sum with imports found in .gitignore Nov 21, 2020
@ianlancetaylor
Copy link
Contributor

I don't think the go tool should be aware of the Git specific .gitignore file.

See also #30058.

@ianlancetaylor ianlancetaylor added GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Nov 21, 2020
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Nov 21, 2020
@ianlancetaylor
Copy link
Contributor

CC @bcmills @jayconrod

@mkungla
Copy link
Contributor Author

mkungla commented Nov 21, 2020

@seankhliao Can you elaborate your reaction?

@seankhliao
Copy link
Member

Same as above, the go tool should not be aware of git ignore things and the dependencies for your experiments still need to be tracked somewhere

@mkungla
Copy link
Contributor Author

mkungla commented Nov 22, 2020

Well, this behavior can now be achieved by placing an empty go.mod file in that directory.

@bcmills
Copy link
Contributor

bcmills commented Nov 22, 2020

I agree with @ianlancetaylor and @seankhliao: the go command should not try to interpret vcs-specific files. Plus, we already have at least two mechanisms to ignore files: // +build ignore to ignore files, and dropping in a go.mod file to ignore directory subtrees. I don't see a pressing need for yet another.

@bcmills bcmills closed this as completed Nov 22, 2020
@golang golang locked and limited conversation to collaborators Nov 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants