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

[modules/go] re-write go vet target #109

Merged
merged 2 commits into from
Sep 20, 2018
Merged

[modules/go] re-write go vet target #109

merged 2 commits into from
Sep 20, 2018

Conversation

alebabai
Copy link
Contributor

what

use go too vet $dir to vet code

why

go vet command require:

named files must all be in one directory; have ...

Should fix cloudposse/github-authorized-keys#29

use `go too vet $dir` to vet code
@@ -6,7 +6,7 @@ go/lint: $(GO) go/vet
## Vet code
go/vet: $(GO)
$(call assert-set,GO)
find . ! -path "*/vendor/*" ! -path "*/.glide/*" -type f -name '*.go' | xargs $(GO) vet -v
$(GO) tool vet -v $(CURDIR)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this go recursively? E.g. projects have go code in multiple folders.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeap, it recursively descends the directory, vetting each package it finds.
https://golang.org/cmd/vet/#hdr-Using_vet_directly

Copy link
Member

@osterman osterman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment

@osterman
Copy link
Member

But we need to exclude the vendor folder since we have to control over the formatting of 3rd party code. Will this automatically exclude that?

@alebabai
Copy link
Contributor Author

@osterman hm, you're right.
i'll bring old solution with find, but using go tool vet

@alebabai alebabai merged commit 518fc1e into master Sep 20, 2018
@alebabai alebabai deleted the feature/fix-go-vet branch September 20, 2018 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix CI/CD
2 participants