From a783b25fe5e65c3d4eb0281d835ed1fa88b08365 Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Mon, 13 Apr 2020 12:37:38 -0700 Subject: [PATCH] internal: rename proto import to end with pb (#3523) --- vet.sh | 3 +++ xds/internal/testutils/balancer.go | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/vet.sh b/vet.sh index e12024fb..5f79fa6e 100755 --- a/vet.sh +++ b/vet.sh @@ -88,6 +88,9 @@ git grep -l '"math/rand"' -- "*.go" 2>&1 | not grep -v '^examples\|^stress\|grpc # - Ensure all ptypes proto packages are renamed when importing. not git grep "\(import \|^\s*\)\"github.com/golang/protobuf/ptypes/" -- "*.go" +# - Ensure all xds proto imports are renamed to *pb or *grpc. +git grep '"github.com/envoyproxy/go-control-plane/envoy' -- '*.go' | not grep -v 'pb "\|grpc "' + # - Check imports that are illegal in appengine (until Go 1.11). # TODO: Remove when we drop Go 1.10 support go list -f {{.Dir}} ./... | xargs go run test/go_vet/vet.go diff --git a/xds/internal/testutils/balancer.go b/xds/internal/testutils/balancer.go index 9ffbee23..d6cc3f7b 100644 --- a/xds/internal/testutils/balancer.go +++ b/xds/internal/testutils/balancer.go @@ -24,7 +24,7 @@ import ( "sync" "testing" - envoy_api_v2_core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core" + corepb "github.com/envoyproxy/go-control-plane/envoy/api/v2/core" "google.golang.org/grpc" "google.golang.org/grpc/balancer" "google.golang.org/grpc/connectivity" @@ -189,7 +189,7 @@ func (tls *TestLoadStore) CallServerLoad(l internal.Locality, name string, d flo } // ReportTo panics. -func (*TestLoadStore) ReportTo(ctx context.Context, cc *grpc.ClientConn, clusterName string, node *envoy_api_v2_core.Node) { +func (*TestLoadStore) ReportTo(ctx context.Context, cc *grpc.ClientConn, clusterName string, node *corepb.Node) { panic("not implemented") }