Skip to content

Commit bcae041

Browse files
fix(spanner): address review comments and format imports cleanly
1 parent 71e0227 commit bcae041

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

spanner/grpc_client.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ import (
3434
"google.golang.org/grpc/status"
3535
)
3636

37-
38-
3937
type contextKey string
4038

4139
const metricsTracerKey contextKey = "metricsTracer"

spanner/integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ import (
5757
"google.golang.org/api/option/internaloption"
5858
"google.golang.org/grpc"
5959
"google.golang.org/grpc/codes"
60-
"google.golang.org/grpc/credentials/insecure"
6160
"google.golang.org/grpc/credentials/alts"
61+
"google.golang.org/grpc/credentials/insecure"
6262
"google.golang.org/grpc/peer"
6363
"google.golang.org/grpc/status"
6464
"google.golang.org/protobuf/proto"

spanner/metrics.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ import (
3737
"google.golang.org/api/option"
3838
"google.golang.org/grpc"
3939
"google.golang.org/grpc/codes"
40-
"google.golang.org/grpc/experimental/stats"
4140
"google.golang.org/grpc/credentials/alts"
41+
"google.golang.org/grpc/experimental/stats"
4242
"google.golang.org/grpc/peer"
4343
"google.golang.org/grpc/stats/opentelemetry"
4444
"google.golang.org/grpc/status"
@@ -534,7 +534,7 @@ func (o *opTracer) incrementAttemptCount() {
534534
// setDirectPathUsed sets whether DirectPath was used for the attempt.
535535
func (a *attemptTracer) setDirectPathUsed(ctx context.Context) {
536536
peerInfo, ok := peer.FromContext(ctx)
537-
if ok && peerInfo.AuthInfo != nil {
537+
if ok {
538538
if _, isALTS := peerInfo.AuthInfo.(alts.AuthInfo); isALTS {
539539
a.directPathUsed = true
540540
}

spanner/metrics_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ import (
3131
"google.golang.org/genproto/googleapis/api/metric"
3232
"google.golang.org/grpc"
3333
"google.golang.org/grpc/codes"
34-
"google.golang.org/grpc/credentials/insecure"
3534
"google.golang.org/grpc/credentials/alts"
35+
"google.golang.org/grpc/credentials/insecure"
3636
"google.golang.org/grpc/peer"
3737
"google.golang.org/grpc/status"
3838
)
@@ -320,9 +320,11 @@ func parseHex(hexStr string) (int64, error) {
320320
type mockALTSAuthInfo struct {
321321
alts.AuthInfo
322322
}
323+
323324
func (m mockALTSAuthInfo) AuthType() string { return "alts" }
324325

325326
type mockOtherAuthInfo struct{}
327+
326328
func (m mockOtherAuthInfo) AuthType() string { return "other" }
327329

328330
func TestSetDirectPathUsed(t *testing.T) {

0 commit comments

Comments
 (0)