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: gofmt should ignore vendor #33962

Open
abhigenie92 opened this issue Aug 30, 2019 · 3 comments

Comments

@abhigenie92
Copy link

commented Aug 30, 2019

When you run go fmt $$(go list ./...) it ignores vendor by default but gofmt . doesn't do that.
The use case is if you run fmt without the code modification in-place and ignore the vendor.

One way is gofmt -l (find . -type f -name '*.go'| grep -v "/vendor/"), is there an easier way?

@katiehockman katiehockman changed the title Make gofmt ignore vendor? cmd/go: gofmt should ignore vendor Sep 3, 2019

@katiehockman

This comment has been minimized.

Copy link
Contributor

commented Sep 3, 2019

@bcmills

This comment has been minimized.

Copy link
Member

commented Sep 3, 2019

@abhigenie92, please fill out the full issue template — specifically, it would be helpful to know the exact commands you ran that led to confusion, and to clarify what you observed vs. what you expected.

Specifically:

  • What concrete problem were you trying to solve that led you to run gofmt .?
  • Did you actively cd into the vendor directory before running the command?
  • Are you talking about the behavior of go fmt ., or gofmt .? (That is, is this the problem found in cmd/go, cmd/gofmt, or both?) How did you choose between them?
@bcmills

This comment has been minimized.

Copy link
Member

commented Sep 3, 2019

See also #29751.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.