diff --git a/transport/grpc/dial.go b/transport/grpc/dial.go index 5ec81f85018..2e66d02b378 100644 --- a/transport/grpc/dial.go +++ b/transport/grpc/dial.go @@ -213,8 +213,8 @@ func dialPoolNewAuth(ctx context.Context, secure bool, poolSize int, ds *interna } // Defaults for older clients that don't set this value yet - var defaultEndpointTemplate string - if ds.DefaultEndpointTemplate == "" { + defaultEndpointTemplate := ds.DefaultEndpointTemplate + if defaultEndpointTemplate == "" { defaultEndpointTemplate = ds.DefaultEndpoint } diff --git a/transport/http/dial.go b/transport/http/dial.go index 64c881025a1..2043118b528 100644 --- a/transport/http/dial.go +++ b/transport/http/dial.go @@ -91,8 +91,8 @@ func newClientNewAuth(ctx context.Context, ds *internal.DialSettings) (*http.Cli } // Defaults for older clients that don't set this value yet - var defaultEndpointTemplate string - if ds.DefaultEndpointTemplate == "" { + defaultEndpointTemplate := ds.DefaultEndpointTemplate + if defaultEndpointTemplate == "" { defaultEndpointTemplate = ds.DefaultEndpoint }