Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing some linter issues #1777

Merged
merged 1 commit into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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