Skip to content

Commit

Permalink
Upgrade to test against Go 1.19,1.20 (#22)
Browse files Browse the repository at this point in the history
* Upgrade to test against 1.19,1.20

* Fix regressions from upgrade of golangci-lint and go
  • Loading branch information
kpurdon authored Apr 18, 2023
1 parent c508760 commit 4b43213
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -23,4 +23,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.49
version: v1.52
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions member_names_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
11 changes: 2 additions & 9 deletions unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}

0 comments on commit 4b43213

Please sign in to comment.