From e7af99e2f710fe581f736b669812deb209825769 Mon Sep 17 00:00:00 2001 From: Adam Chalkley Date: Tue, 13 Feb 2024 05:59:54 -0600 Subject: [PATCH] Fix `unused-parameter` revive linting errors Resolve multiple linting errors flagged by recent linter releases (golangci-lint, revive). --- cmd/check_vmware_hs2ds2vms/main.go | 6 +++--- internal/vsphere/snapshots.go | 2 +- internal/vsphere/vms.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/check_vmware_hs2ds2vms/main.go b/cmd/check_vmware_hs2ds2vms/main.go index 35a33f39..f329cef3 100644 --- a/cmd/check_vmware_hs2ds2vms/main.go +++ b/cmd/check_vmware_hs2ds2vms/main.go @@ -301,9 +301,9 @@ func main() { hostID, pairing := hostID, pairing dsNamesForHost := func(pairings vsphere.HostDatastoresPairing) string { - names := make([]string, len(pairing.Datastores)) - for i := range pairing.Datastores { - names[i] = pairing.Datastores[i].Name + names := make([]string, len(pairings.Datastores)) + for i := range pairings.Datastores { + names[i] = pairings.Datastores[i].Name } return strings.Join(names, ", ") }(pairing) diff --git a/internal/vsphere/snapshots.go b/internal/vsphere/snapshots.go index 0378a7e7..e449b8bc 100644 --- a/internal/vsphere/snapshots.go +++ b/internal/vsphere/snapshots.go @@ -868,7 +868,7 @@ func ListVMSnapshots(vm mo.VirtualMachine, w io.Writer) { var listFunc func(mo.VirtualMachine, []types.VirtualMachineSnapshotTree, *types.ManagedObjectReference) - listFunc = func(vm mo.VirtualMachine, snapTrees []types.VirtualMachineSnapshotTree, parent *types.ManagedObjectReference) { + listFunc = func(vm mo.VirtualMachine, snapTrees []types.VirtualMachineSnapshotTree, _ *types.ManagedObjectReference) { if len(snapTrees) == 0 { return diff --git a/internal/vsphere/vms.go b/internal/vsphere/vms.go index e4e30317..98f74565 100644 --- a/internal/vsphere/vms.go +++ b/internal/vsphere/vms.go @@ -1261,7 +1261,7 @@ func getVMsCountUsingRootFolderContainerView( logger.Printf( "It took %v to execute getVMsCountUsingRootFolderContainerView func (and count %d VMs).\n", time.Since(funcTimeStart), - len(allVMs), + len(*vms), ) }(&allVMs)