Skip to content

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

Merged
alebabai merged 2 commits intomasterfrom
feature/fix-go-vet
Sep 20, 2018
Merged

[modules/go] re-write go vet target#109
alebabai merged 2 commits intomasterfrom
feature/fix-go-vet

Conversation

@alebabai
Copy link
Copy Markdown
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
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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