Skip to content

Commit

Permalink
chore: fix linter issues (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
abemedia authored Sep 1, 2024
1 parent 97eb566 commit 6b280c6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion decoder/adapters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ func testAdapter(t *testing.T, in decoder.Getter) {
}

if diff := cmp.Diff(want, got); diff != "" {
t.Errorf(diff)
t.Error(diff)
}
}
4 changes: 2 additions & 2 deletions decoder/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ func set[T any](ptr bool, i int, t reflect.Type) func(reflect.Value, T) {
if f.IsNil() {
f.Set(reflect.New(t))
}
*(*T)(unsafe.Pointer(f.Elem().UnsafeAddr())) = d
*(*T)(unsafe.Pointer(f.Elem().UnsafeAddr())) = d //nolint:gosec // false positive
}
}

return func(v reflect.Value, d T) {
*(*T)(unsafe.Pointer(v.Field(i).UnsafeAddr())) = d
*(*T)(unsafe.Pointer(v.Field(i).UnsafeAddr())) = d //nolint:gosec // false positive
}
}

Expand Down
8 changes: 4 additions & 4 deletions decoder/decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestDecode(t *testing.T) {
t.Fatal(err)
}
if diff := cmp.Diff(expected, actual, exportAll); diff != "" {
t.Errorf(diff)
t.Error(diff)
}
})

Expand All @@ -108,7 +108,7 @@ func TestDecode(t *testing.T) {
t.Fatal(err)
}
if diff := cmp.Diff(expected, actual, exportAll); diff != "" {
t.Errorf(diff)
t.Error(diff)
}

actual = &test{}
Expand All @@ -117,7 +117,7 @@ func TestDecode(t *testing.T) {
t.Fatal(err)
}
if diff := cmp.Diff(expected, actual, exportAll); diff != "" {
t.Errorf(diff)
t.Error(diff)
}
})

Expand All @@ -132,7 +132,7 @@ func TestDecode(t *testing.T) {
t.Fatal(err)
}
if diff := cmp.Diff(expected, actual, exportAll); diff != "" {
t.Errorf(diff)
t.Error(diff)
}
})
}
Expand Down

0 comments on commit 6b280c6

Please sign in to comment.