@@ -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
8484func 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
9999func 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