diff --git a/cmd/common_test.go b/cmd/common_test.go index eda3799a..17a0d65e 100644 --- a/cmd/common_test.go +++ b/cmd/common_test.go @@ -82,7 +82,6 @@ func (c *test[R]) testCmd(t *testing.T) { } for _, format := range outputFormats(c) { - format := format t.Run(fmt.Sprintf("%v", format.Args()), func(t *testing.T) { _, out, config := c.newMockConfig(t) diff --git a/cmd/completion/machine.go b/cmd/completion/machine.go index 98e701b8..a48cee92 100644 --- a/cmd/completion/machine.go +++ b/cmd/completion/machine.go @@ -94,8 +94,6 @@ func (c *Completion) IssueTypeCompletion(cmd *cobra.Command, args []string, toCo } var names []string for _, issue := range resp.Payload { - issue := issue - if issue.ID == nil { continue } @@ -119,8 +117,6 @@ func (c *Completion) IssueSeverityCompletion(cmd *cobra.Command, args []string, severities := map[string]bool{} for _, issue := range resp.Payload { - issue := issue - if issue.Severity == nil { continue } diff --git a/cmd/machine.go b/cmd/machine.go index 1f94570b..01ac8dd6 100644 --- a/cmd/machine.go +++ b/cmd/machine.go @@ -90,7 +90,6 @@ func (c *machineCmd) listCmdFlags(cmd *cobra.Command, lastEventErrorThresholdDef cmd.Flags().String("network-ips", "", "network ips to filter [optional]") for _, c := range listFlagCompletions { - c := c genericcli.Must(cmd.RegisterFlagCompletionFunc(c.flagName, c.f)) } diff --git a/cmd/partition.go b/cmd/partition.go index 8d08c307..7f64e680 100644 --- a/cmd/partition.go +++ b/cmd/partition.go @@ -176,7 +176,6 @@ func (c *partitionCmd) partitionCapacity() error { } for _, pc := range resp.Payload { - pc := pc sort.SliceStable(pc.Servers, func(i, j int) bool { return pointer.SafeDeref(pointer.SafeDeref(pc.Servers[i]).Size) < pointer.SafeDeref(pointer.SafeDeref(pc.Servers[j]).Size) }) diff --git a/cmd/switch.go b/cmd/switch.go index 3ffb163c..8c0723b1 100644 --- a/cmd/switch.go +++ b/cmd/switch.go @@ -334,8 +334,6 @@ func (c *switchCmd) switchMachines() error { ms := map[string]*models.V1MachineIPMIResponse{} for _, m := range machines { - m := m - if m.ID == nil { continue } diff --git a/cmd/tableprinters/machine.go b/cmd/tableprinters/machine.go index 8805a367..5bf8f5d6 100644 --- a/cmd/tableprinters/machine.go +++ b/cmd/tableprinters/machine.go @@ -311,8 +311,6 @@ func (t *TablePrinter) MachineIssuesTable(data *MachinesAndIssues, wide bool) ([ machinesByID := map[string]*models.V1MachineIPMIResponse{} for _, m := range data.Machines { - m := m - if m.ID == nil { continue } @@ -322,8 +320,6 @@ func (t *TablePrinter) MachineIssuesTable(data *MachinesAndIssues, wide bool) ([ issuesByID := map[string]*models.V1MachineIssue{} for _, issue := range data.Issues { - issue := issue - if issue.ID == nil { continue } diff --git a/cmd/tableprinters/partition.go b/cmd/tableprinters/partition.go index bef3b11a..e0ac1248 100644 --- a/cmd/tableprinters/partition.go +++ b/cmd/tableprinters/partition.go @@ -58,8 +58,6 @@ func (t *TablePrinter) PartitionCapacityTable(data []*models.V1PartitionCapacity } for _, pc := range data { - pc := pc - for _, c := range pc.Servers { id := pointer.SafeDeref(c.Size) diff --git a/cmd/tableprinters/size.go b/cmd/tableprinters/size.go index d0079f84..b7533d0d 100644 --- a/cmd/tableprinters/size.go +++ b/cmd/tableprinters/size.go @@ -65,8 +65,6 @@ func (t *TablePrinter) SizeReservationTable(data []*models.V1SizeReservationResp } for _, d := range data { - d := d - desc := d.Description if !wide { desc = genericcli.TruncateEnd(d.Description, 50) @@ -104,8 +102,6 @@ func (t *TablePrinter) SizeReservationUsageTable(data []*models.V1SizeReservatio } for _, d := range data { - d := d - row := []string{ pointer.SafeDeref(d.ID), pointer.SafeDeref(d.Sizeid), diff --git a/cmd/tableprinters/switch.go b/cmd/tableprinters/switch.go index f56f5104..8505b319 100644 --- a/cmd/tableprinters/switch.go +++ b/cmd/tableprinters/switch.go @@ -165,8 +165,6 @@ func (t *TablePrinter) SwitchWithConnectedMachinesTable(data *SwitchesWithMachin filteredConns := []*models.V1SwitchConnection{} for _, conn := range s.Connections { - conn := conn - m, ok := data.MS[conn.MachineID] if !ok { continue @@ -298,7 +296,6 @@ func (t *TablePrinter) SwitchDetailTable(data []*SwitchDetail, wide bool) ([]str ) for _, sw := range data { - sw := sw filterBySwp := map[string]models.V1BGPFilter{} for _, n := range sw.Nics { swp := *(n.Name)