Skip to content

Commit 5f55c6a

Browse files
authored
ci(lint): enable testifylint linter (#4010)
Signed-off-by: Matthieu MOREL <[email protected]>
1 parent 626d55b commit 5f55c6a

20 files changed

+461
-452
lines changed

.golangci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ linters:
1717
- nilerr
1818
- nolintlint
1919
- revive
20+
- testifylint
2021
- wastedassign
2122

2223
linters-settings:
@@ -33,6 +34,8 @@ linters-settings:
3334
- G112
3435
- G201
3536
- G203
37+
testifylint:
38+
enable-all: true
3639

3740
issues:
3841
exclude-rules:

binding/binding_msgpack_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"testing"
1212

1313
"github.com/stretchr/testify/assert"
14+
"github.com/stretchr/testify/require"
1415
"github.com/ugorji/go/codec"
1516
)
1617

@@ -24,7 +25,7 @@ func TestBindingMsgPack(t *testing.T) {
2425
buf := bytes.NewBuffer([]byte{})
2526
assert.NotNil(t, buf)
2627
err := codec.NewEncoder(buf, h).Encode(test)
27-
assert.NoError(t, err)
28+
require.NoError(t, err)
2829

2930
data := buf.Bytes()
3031

@@ -41,14 +42,14 @@ func testMsgPackBodyBinding(t *testing.T, b Binding, name, path, badPath, body,
4142
req := requestWithBody("POST", path, body)
4243
req.Header.Add("Content-Type", MIMEMSGPACK)
4344
err := b.Bind(req, &obj)
44-
assert.NoError(t, err)
45+
require.NoError(t, err)
4546
assert.Equal(t, "bar", obj.Foo)
4647

4748
obj = FooStruct{}
4849
req = requestWithBody("POST", badPath, badBody)
4950
req.Header.Add("Content-Type", MIMEMSGPACK)
5051
err = MsgPack.Bind(req, &obj)
51-
assert.Error(t, err)
52+
require.Error(t, err)
5253
}
5354

5455
func TestBindingDefaultMsgPack(t *testing.T) {

0 commit comments

Comments
 (0)