Skip to content

Commit

Permalink
ci(lint): enable testifylint linter (#4010)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 authored Jul 14, 2024
1 parent 626d55b commit 5f55c6a
Show file tree
Hide file tree
Showing 20 changed files with 461 additions and 452 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ linters:
- nilerr
- nolintlint
- revive
- testifylint
- wastedassign

linters-settings:
Expand All @@ -33,6 +34,8 @@ linters-settings:
- G112
- G201
- G203
testifylint:
enable-all: true

issues:
exclude-rules:
Expand Down
7 changes: 4 additions & 3 deletions binding/binding_msgpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/ugorji/go/codec"
)

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

data := buf.Bytes()

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

obj = FooStruct{}
req = requestWithBody("POST", badPath, badBody)
req.Header.Add("Content-Type", MIMEMSGPACK)
err = MsgPack.Bind(req, &obj)
assert.Error(t, err)
require.Error(t, err)
}

func TestBindingDefaultMsgPack(t *testing.T) {
Expand Down
Loading

0 comments on commit 5f55c6a

Please sign in to comment.