Skip to content

Commit 0d61c80

Browse files
committed
fix linter
1 parent d091205 commit 0d61c80

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

thrift/sql/serializing.go

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ type NullableThrift[T any, PT TStructPtr[T]] struct {
3131
func (t *NullableThrift[T, PT]) Scan(value any) error {
3232
if value == nil {
3333
t.Data = nil
34+
3435
return nil
3536
}
3637

thrift/sql/serializing_test.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import (
66
"testing"
77

88
"github.com/stretchr/testify/assert"
9+
"github.com/stretchr/testify/require"
10+
"github.com/upfluence/errors"
911
"github.com/upfluence/thrift/lib/go/thrift"
1012
)
1113

@@ -14,14 +16,14 @@ type fakeTStruct struct {
1416
}
1517

1618
func (t fakeTStruct) Write(p thrift.TProtocol) error {
17-
return p.WriteI64(t.value)
19+
return errors.WithStack(p.WriteI64(t.value))
1820
}
1921

2022
func (t *fakeTStruct) Read(p thrift.TProtocol) error {
2123
val, err := p.ReadI64()
2224

2325
if err != nil {
24-
return err
26+
return errors.WithStack(err)
2527
}
2628

2729
t.value = val
@@ -67,9 +69,9 @@ func TestNullableThrift_Scan(t *testing.T) {
6769
)
6870

6971
if tt.wantErr {
70-
assert.Error(t, err)
72+
require.Error(t, err)
7173
} else {
72-
assert.NoError(t, err)
74+
require.NoError(t, err)
7375
}
7476

7577
assert.Equal(t, tt.wantValue, s.Data)
@@ -107,9 +109,9 @@ func TestNullableThrift_Value(t *testing.T) {
107109
)
108110

109111
if tt.wantErr {
110-
assert.Error(t, err)
112+
require.Error(t, err)
111113
} else {
112-
assert.NoError(t, err)
114+
require.NoError(t, err)
113115
}
114116

115117
assert.Equal(t, tt.wantData, data)

0 commit comments

Comments
 (0)