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

cmd/go: do not update go.mod and go.sum with imports found in .gitignore #42763

mkungla opened this issue Nov 21, 2020 · 6 comments

Comments

@mkungla
Copy link
Contributor

@mkungla 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

@ianlancetaylor ianlancetaylor commented Nov 21, 2020

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

See also #30058.

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Nov 21, 2020

@mkungla
Copy link
Contributor Author

@mkungla mkungla commented Nov 21, 2020

@seankhliao Can you elaborate your reaction?

@seankhliao
Copy link
Contributor

@seankhliao seankhliao commented Nov 22, 2020

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 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
Member

@bcmills 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 Nov 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.