Skip to content

Commit fbba2d6

Browse files
anjannathadrianriobo
authored andcommitted
fix declaration of err shadowing existing err var
this runs `make fmt` and fixes the formatting issue in the azure/data/images.go file
1 parent 350ab6c commit fbba2d6

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

pkg/provider/aws/action/openshift-snc/openshift-snc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ func Create(ctx *maptContext.ContextArgs, args *OpenshiftSNCArgs) error {
100100
func Destroy(ctx *maptContext.ContextArgs) (err error) {
101101
logging.Debug("Run openshift destroy")
102102
// Create mapt Context
103-
if err := maptContext.Init(ctx, aws.Provider()); err != nil {
103+
if err = maptContext.Init(ctx, aws.Provider()); err != nil {
104104
return err
105105
}
106106
// Destroy fedora related resources
107-
if err := aws.DestroyStack(
107+
if err = aws.DestroyStack(
108108
aws.DestroyStackRequest{
109109
Stackname: stackName,
110110
}); err != nil {

pkg/provider/azure/data/images.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func SkuG2Support(location string, publisher string, offer string, sku string) (
6767
return "", err
6868
}
6969
imagesClient := clientFactory.NewVirtualMachineImagesClient()
70-
if ! verify_g2(imagesClient, location, publisher, offer, sku) {
70+
if !verify_g2(imagesClient, location, publisher, offer, sku) {
7171
finalSKU, err := get_g2_sku(imagesClient, location, publisher, offer, sku)
7272
if err == nil && finalSKU != "" {
7373
if verify_g2(imagesClient, location, publisher, offer, finalSKU) {
@@ -77,27 +77,27 @@ func SkuG2Support(location string, publisher string, offer string, sku string) (
7777
}
7878
} else {
7979
return sku, nil
80-
}
80+
}
8181
return "", fmt.Errorf("the SKU %s is not support for G2", sku)
8282
}
8383

8484
func verify_g2(imagesClient *armcompute.VirtualMachineImagesClient, location string, publisher string, offer string, sku string) bool {
8585
// List available image versions
86-
resp, err := imagesClient.List(context.Background(),location, publisher, offer, sku, nil)
86+
resp, err := imagesClient.List(context.Background(), location, publisher, offer, sku, nil)
8787
if err != nil {
8888
return false
89-
}
89+
}
9090

9191
image := resp.VirtualMachineImageResourceArray[0]
9292
version := *image.Name
93-
resps, _ := imagesClient.Get(context.Background(),location, publisher, offer, sku, version, nil)
93+
resps, _ := imagesClient.Get(context.Background(), location, publisher, offer, sku, version, nil)
9494
info := resps.VirtualMachineImage
9595
generation := *info.Properties.HyperVGeneration
9696
return generation == "V2"
9797
}
9898

9999
func get_g2_sku(imagesClient *armcompute.VirtualMachineImagesClient, location string, publisher string, offer string, originSKU string) (string, error) {
100-
resp, err := imagesClient.ListSKUs(context.Background(),location, publisher, offer, nil)
100+
resp, err := imagesClient.ListSKUs(context.Background(), location, publisher, offer, nil)
101101
if err != nil {
102102
return "", err
103103
}
@@ -107,4 +107,4 @@ func get_g2_sku(imagesClient *armcompute.VirtualMachineImagesClient, location st
107107
}
108108
}
109109
return "", nil
110-
}
110+
}

0 commit comments

Comments
 (0)