Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v5
- uses: golangci/golangci-lint-action@v9
with:
version: v2.9
version: v2.13

commit:
runs-on: ubuntu-24.04
Expand Down
4 changes: 2 additions & 2 deletions validate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -742,13 +742,13 @@ func isStruct(t reflect.Type) bool {
}

func isStructPtr(t reflect.Type) bool {
return t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Struct
return t.Kind() == reflect.Pointer && t.Elem().Kind() == reflect.Struct
}

func checkMandatoryUnit(field reflect.Value, tagField reflect.StructField, parent string) (errs error) {
mandatory := !strings.Contains(tagField.Tag.Get("json"), "omitempty")
switch field.Kind() {
case reflect.Ptr:
case reflect.Pointer:
if mandatory && field.IsNil() {
errs = multierror.Append(errs, fmt.Errorf("'%s.%s' should not be empty", parent, tagField.Name))
}
Expand Down
4 changes: 2 additions & 2 deletions validate/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ func TestCheckHooks(t *testing.T) {
val: rspec.Spec{
Version: "1.0.0",
Hooks: &rspec.Hooks{
Prestart: []rspec.Hook{
Prestart: []rspec.Hook{ //nolint:staticcheck // Ignore SA1019: rspec.Hooks.Prestart is deprecated
{
Path: "/usr/bin/fix-mounts",
},
Expand All @@ -682,7 +682,7 @@ func TestCheckHooks(t *testing.T) {
val: rspec.Spec{
Version: "1.0.0",
Hooks: &rspec.Hooks{
Prestart: []rspec.Hook{
Prestart: []rspec.Hook{ //nolint:staticcheck // Ignore SA1019: rspec.Hooks.Prestart is deprecated
{
Path: "usr",
},
Expand Down
Loading