From 6b280c6a1217f3d67543cecf7fe752511683de0e Mon Sep 17 00:00:00 2001 From: Adam Bouqdib Date: Sun, 1 Sep 2024 12:54:50 +0100 Subject: [PATCH] chore: fix linter issues (#226) --- decoder/adapters_test.go | 2 +- decoder/compile.go | 4 ++-- decoder/decode_test.go | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/decoder/adapters_test.go b/decoder/adapters_test.go index 3a0ef7d..fc21812 100644 --- a/decoder/adapters_test.go +++ b/decoder/adapters_test.go @@ -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) } } diff --git a/decoder/compile.go b/decoder/compile.go index b7c071a..5fa15c8 100644 --- a/decoder/compile.go +++ b/decoder/compile.go @@ -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 } } diff --git a/decoder/decode_test.go b/decoder/decode_test.go index b23ed21..12a34c3 100644 --- a/decoder/decode_test.go +++ b/decoder/decode_test.go @@ -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) } }) @@ -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{} @@ -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) } }) @@ -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) } }) }