File tree 2 files changed +12
-5
lines changed
cmd/check_vmware_hs2ds2vms
2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -298,7 +298,10 @@ func main() {
298
298
// Reassign the iteration variable inside the loop to prevent implicit
299
299
// memory aliasing.
300
300
// https://stackoverflow.com/questions/62446118/implicit-memory-aliasing-in-for-loop
301
- hostID , pairing := hostID , pairing
301
+ //
302
+ // NOTE: Not needed as of Go 1.22.
303
+ //
304
+ // hostID, pairing := hostID, pairing
302
305
303
306
dsNamesForHost := func (pairings vsphere.HostDatastoresPairing ) string {
304
307
names := make ([]string , len (pairings .Datastores ))
Original file line number Diff line number Diff line change @@ -875,10 +875,12 @@ func ListVMSnapshots(vm mo.VirtualMachine, w io.Writer) {
875
875
}
876
876
877
877
for _ , snapTree := range snapTrees {
878
-
879
878
// G601: Implicit memory aliasing in for loop
880
879
// https://stackoverflow.com/questions/62446118/implicit-memory-aliasing-in-for-loop
881
- snapTree := snapTree
880
+ //
881
+ // NOTE: Not needed as of Go 1.22.
882
+ //
883
+ // snapTree := snapTree
882
884
883
885
daysAge := now .Sub (snapTree .CreateTime ).Hours () / 24
884
886
@@ -986,10 +988,12 @@ func NewSnapshotSummarySet(
986
988
}
987
989
988
990
for _ , snapTree := range snapTrees {
989
-
990
991
// G601: Implicit memory aliasing in for loop
991
992
// https://stackoverflow.com/questions/62446118/implicit-memory-aliasing-in-for-loop
992
- snapTree := snapTree
993
+ //
994
+ // NOTE: Not needed as of Go 1.22.
995
+ //
996
+ // snapTree := snapTree
993
997
994
998
logger .Printf (
995
999
"Processing snapshot: [ID: %s, Name: %s, HasParent: %t]\n " ,
You can’t perform that action at this time.
0 commit comments