-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
vet: disallow importing "unsafe" #2024
Conversation
vet.sh
Outdated
@@ -49,6 +49,7 @@ if git status --porcelain | read; then | |||
fi | |||
|
|||
git ls-files "*.go" | xargs grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)\|DO NOT EDIT" 2>&1 | tee /dev/stderr | (! read) | |||
git ls-files "*.go" | xargs grep -l "\"unsafe\"" 2>&1 | grep -v 'primitives_test.go' | tee /dev/stderr | (! read) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: maybe "_test.go"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
The exit status is 1 if no match was found.
vet.sh
Outdated
@@ -49,7 +49,7 @@ if git status --porcelain | read; then | |||
fi | |||
|
|||
git ls-files "*.go" | xargs grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)\|DO NOT EDIT" 2>&1 | tee /dev/stderr | (! read) | |||
git ls-files "*.go" | xargs grep -l "\"unsafe\"" 2>&1 | grep -v '_test.go' | tee /dev/stderr | (! read) | |||
git ls-files "*.go" | xargs grep -l "\"unsafe\"" 2>&1 | (! grep -v '_test.go') | tee /dev/stderr | (! read) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the exit status is being checked, I think you can remove the | tee /dev/stderr | (! read)
.
EDIT: Same with above?
#2022