diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 08fdcf2..177260d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: [1.18, 1.19] + go: ['1.19', '1.20'] steps: - uses: actions/setup-go@v3 with: @@ -23,4 +23,4 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.49 + version: v1.52 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b94108e..25aece4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: - run: git fetch --force --tags - uses: actions/setup-go@v2 with: - go-version: 1.19 + go-version: '1.20' - uses: goreleaser/goreleaser-action@v2 with: # either 'goreleaser' (default) or 'goreleaser-pro' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2372810..af35589 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: [1.18, 1.19] + go: ['1.19', '1.20'] steps: - uses: actions/setup-go@v3 with: diff --git a/member_names_test.go b/member_names_test.go index 8fc934c..f4aded2 100644 --- a/member_names_test.go +++ b/member_names_test.go @@ -39,6 +39,7 @@ func TestIsValidMemberName(t *testing.T) { for mode, names := range testValidations { mode := mode for _, name := range names { + name := name t.Run(name, func(t *testing.T) { t.Parallel() diff --git a/unmarshal.go b/unmarshal.go index 79c60fd..740661f 100644 --- a/unmarshal.go +++ b/unmarshal.go @@ -184,11 +184,7 @@ func (ro *resourceObject) unmarshal(v any, m *Unmarshaler) error { return err } - if err := ro.unmarshalAttributes(v); err != nil { - return err - } - - return nil + return ro.unmarshalAttributes(v) } // unmarshalFields unmarshals a resource object into all non-attribute struct fields @@ -283,8 +279,5 @@ func (ro *resourceObject) unmarshalAttributes(v any) error { if err != nil { return err } - if err := json.Unmarshal(b, v); err != nil { - return err - } - return nil + return json.Unmarshal(b, v) }