Skip to content

Commit

Permalink
Fixing some linter issues (#1777)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhuss authored Feb 15, 2023
1 parent dfc3c1e commit badd909
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 8 additions & 3 deletions pkg/errors/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,11 @@ func TestIsForbiddenError(t *testing.T) {
},
}
for _, tc := range cases {
err := tc.Error
forbidden := tc.Forbidden
t.Run(tc.Name, func(t *testing.T) {
t.Parallel()
assert.Equal(t, IsForbiddenError(GetError(tc.Error)), tc.Forbidden)
assert.Equal(t, IsForbiddenError(GetError(err)), forbidden)
})
}
}
Expand Down Expand Up @@ -207,9 +209,11 @@ func TestIsInternalError(t *testing.T) {
}

for _, tc := range cases {
err := tc.Error
internal := tc.Internal
t.Run(tc.Name, func(t *testing.T) {
t.Parallel()
assert.Equal(t, api_errors.IsInternalError(GetError(tc.Error)), tc.Internal)
assert.Equal(t, api_errors.IsInternalError(GetError(err)), internal)
})
}
}
Expand Down Expand Up @@ -240,9 +244,10 @@ func TestStatusError(t *testing.T) {
},
}
for _, tc := range cases {
itc := tc
t.Run(tc.Name, func(t *testing.T) {
t.Parallel()
assert.Assert(t, tc.ErrorType(GetError(tc.Error)))
assert.Assert(t, itc.ErrorType(GetError(itc.Error)))
})
}
}
4 changes: 1 addition & 3 deletions pkg/printers/tablegenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ func (h *HumanReadablePrinter) GenerateTable(obj runtime.Object, options PrintOp
}

columns := make([]metav1beta1.TableColumnDefinition, 0, len(handler.columnDefinitions))
for i := range handler.columnDefinitions {
columns = append(columns, handler.columnDefinitions[i])
}
columns = append(columns, handler.columnDefinitions...)

table := &metav1beta1.Table{
ListMeta: metav1.ListMeta{
Expand Down

0 comments on commit badd909

Please sign in to comment.