Skip to content

Commit

Permalink
Fix composite literal uses unkeyed fields for v1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
buzzsurfr committed Dec 20, 2022
1 parent 78646e4 commit 6fa4f78
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/features/authentication/client/main.go
Expand Up @@ -50,7 +50,7 @@ func main() {
flag.Parse()

// Set up the credentials for the connection.
perRPC := oauth.TokenSource{oauth2.StaticTokenSource(fetchToken())}
perRPC := oauth.TokenSource{TokenSource: oauth2.StaticTokenSource(fetchToken())}
creds, err := credentials.NewClientTLSFromFile(data.Path("x509/ca_cert.pem"), "x.test.example.com")
if err != nil {
log.Fatalf("failed to load credentials: %v", err)
Expand Down
4 changes: 2 additions & 2 deletions examples/features/interceptor/client/main.go
Expand Up @@ -56,7 +56,7 @@ func unaryInterceptor(ctx context.Context, method string, req, reply interface{}
}
if !credsConfigured {
opts = append(opts, grpc.PerRPCCredentials(oauth.TokenSource{
oauth2.StaticTokenSource(&oauth2.Token{AccessToken: fallbackToken}),
TokenSource: oauth2.StaticTokenSource(&oauth2.Token{AccessToken: fallbackToken}),
}))
}
start := time.Now()
Expand Down Expand Up @@ -98,7 +98,7 @@ func streamInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.Clie
}
if !credsConfigured {
opts = append(opts, grpc.PerRPCCredentials(oauth.TokenSource{
oauth2.StaticTokenSource(&oauth2.Token{AccessToken: fallbackToken}),
TokenSource: oauth2.StaticTokenSource(&oauth2.Token{AccessToken: fallbackToken}),
}))
}
s, err := streamer(ctx, desc, cc, method, opts...)
Expand Down

0 comments on commit 6fa4f78

Please sign in to comment.