summaryrefslogtreecommitdiff
path: root/vendor/google.golang.org/grpc/vet.sh
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/google.golang.org/grpc/vet.sh')
-rw-r--r--vendor/google.golang.org/grpc/vet.sh47
1 files changed, 20 insertions, 27 deletions
diff --git a/vendor/google.golang.org/grpc/vet.sh b/vendor/google.golang.org/grpc/vet.sh
index 1a0dbd7ee..48652f604 100644
--- a/vendor/google.golang.org/grpc/vet.sh
+++ b/vendor/google.golang.org/grpc/vet.sh
@@ -28,8 +28,7 @@ cleanup() {
}
trap cleanup EXIT
-PATH="${HOME}/go/bin:${GOROOT}/bin:${PATH}"
-go version
+PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}"
if [[ "$1" = "-install" ]]; then
# Check for module support
@@ -54,7 +53,7 @@ if [[ "$1" = "-install" ]]; then
fi
if [[ -z "${VET_SKIP_PROTO}" ]]; then
if [[ "${TRAVIS}" = "true" ]]; then
- PROTOBUF_VERSION=3.14.0
+ PROTOBUF_VERSION=3.3.0
PROTOC_FILENAME=protoc-${PROTOBUF_VERSION}-linux-x86_64.zip
pushd /home/travis
wget https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/${PROTOC_FILENAME}
@@ -62,7 +61,7 @@ if [[ "$1" = "-install" ]]; then
bin/protoc --version
popd
elif [[ "${GITHUB_ACTIONS}" = "true" ]]; then
- PROTOBUF_VERSION=3.14.0
+ PROTOBUF_VERSION=3.3.0
PROTOC_FILENAME=protoc-${PROTOBUF_VERSION}-linux-x86_64.zip
pushd /home/runner/go
wget https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/${PROTOC_FILENAME}
@@ -105,6 +104,12 @@ git grep '"github.com/envoyproxy/go-control-plane/envoy' -- '*.go' ':(exclude)*.
# TODO: Remove when we drop Go 1.10 support
go list -f {{.Dir}} ./... | xargs go run test/go_vet/vet.go
+# - gofmt, goimports, golint (with exceptions for generated code), go vet.
+gofmt -s -d -l . 2>&1 | fail_on_output
+goimports -l . 2>&1 | not grep -vE "\.pb\.go"
+golint ./... 2>&1 | not grep -vE "\.pb\.go:"
+go vet -all ./...
+
misspell -error .
# - Check that generated proto files are up to date.
@@ -114,22 +119,12 @@ if [[ -z "${VET_SKIP_PROTO}" ]]; then
(git status; git --no-pager diff; exit 1)
fi
-# - gofmt, goimports, golint (with exceptions for generated code), go vet,
-# go mod tidy.
-# Perform these checks on each module inside gRPC.
-for MOD_FILE in $(find . -name 'go.mod'); do
- MOD_DIR=$(dirname ${MOD_FILE})
- pushd ${MOD_DIR}
- go vet -all ./... | fail_on_output
- gofmt -s -d -l . 2>&1 | fail_on_output
- goimports -l . 2>&1 | not grep -vE "\.pb\.go"
- golint ./... 2>&1 | not grep -vE "/testv3\.pb\.go:"
-
- go mod tidy
+# - Check that our modules are tidy.
+if go help mod >& /dev/null; then
+ find . -name 'go.mod' | xargs -IXXX bash -c 'cd $(dirname XXX); go mod tidy'
git status --porcelain 2>&1 | fail_on_output || \
(git status; git --no-pager diff; exit 1)
- popd
-done
+fi
# - Collection of static analysis checks
#
@@ -146,11 +141,8 @@ not grep -Fv '.CredsBundle
.NewAddress
.NewServiceConfig
.Type is deprecated: use Attributes
-BuildVersion is deprecated
balancer.ErrTransientFailure
balancer.Picker
-extDesc.Filename is deprecated
-github.com/golang/protobuf/jsonpb is deprecated
grpc.CallCustomCodec
grpc.Code
grpc.Compressor
@@ -172,7 +164,13 @@ grpc.WithServiceConfig
grpc.WithTimeout
http.CloseNotifier
info.SecurityVersion
+resolver.Backend
+resolver.GRPCLB
+extDesc.Filename is deprecated
+BuildVersion is deprecated
+github.com/golang/protobuf/jsonpb is deprecated
proto is deprecated
+xxx_messageInfo_
proto.InternalMessageInfo is deprecated
proto.EnumName is deprecated
proto.ErrInternalBadWireType is deprecated
@@ -186,12 +184,7 @@ proto.RegisterExtension is deprecated
proto.RegisteredExtension is deprecated
proto.RegisteredExtensions is deprecated
proto.RegisterMapType is deprecated
-proto.Unmarshaler is deprecated
-resolver.Backend
-resolver.GRPCLB
-Target is deprecated: Use the Target field in the BuildOptions instead.
-xxx_messageInfo_
-' "${SC_OUT}"
+proto.Unmarshaler is deprecated' "${SC_OUT}"
# - special golint on package comments.
lint_package_comment_per_package() {