Skip to content

Commit

Permalink
[nit] replace if-else cascade by switch #1566
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas11 committed Aug 26, 2022
1 parent 71dd3dd commit f601484
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions provider/pkg/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,14 @@ func (k *azureNativeProvider) Configure(ctx context.Context,

// Translate between the autorest and the azure-sdk-for-go representation of Azure clouds.
func (k *azureNativeProvider) cloud() cloud.Configuration {
thisCloud := cloud.AzurePublic
if k.environment.Name == azure.USGovernmentCloud.Name {
thisCloud = cloud.AzureGovernment
} else if k.environment.Name == azure.ChinaCloud.Name {
thisCloud = cloud.AzureChina
switch k.environment.Name {
case azure.USGovernmentCloud.Name:
return cloud.AzureGovernment
case azure.ChinaCloud.Name:
return cloud.AzureChina
default:
return cloud.AzurePublic
}

return thisCloud
}

// Invoke dynamically executes a built-in function in the provider.
Expand Down

0 comments on commit f601484

Please sign in to comment.