Skip to content

Commit

Permalink
chore(lint): relinted
Browse files Browse the repository at this point in the history
Signed-off-by: Frederic BIDON <[email protected]>
  • Loading branch information
fredbi committed Mar 4, 2024
1 parent 9352cad commit 8e6deda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pointer.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
knd := reflect.ValueOf(node).Kind()

if knd != reflect.Ptr && knd != reflect.Struct && knd != reflect.Map && knd != reflect.Slice && knd != reflect.Array {
return fmt.Errorf("only structs, pointers, maps and slices are supported for setting values")
return errors.New("only structs, pointers, maps and slices are supported for setting values")
}

if nameProvider == nil {
Expand Down
8 changes: 4 additions & 4 deletions pointer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func TestEscaping(t *testing.T) {
result, _, err := p.Get(testDocumentJSON)

require.NoError(t, err, "input: %v", ins[i])
assert.Equal(t, outs[i], result, "input: %v", ins[i])
assert.InDeltaf(t, outs[i], result, 1e-6, "input: %v", ins[i])
}

}
Expand Down Expand Up @@ -352,15 +352,15 @@ func TestObject(t *testing.T) {

result, _, err := p.Get(testDocumentJSON)
require.NoError(t, err)
assert.Equal(t, outs[i], result)
assert.InDelta(t, outs[i], result, 1e-6)

result, _, err = p.Get(testStructJSONDoc)
require.NoError(t, err)
assert.EqualValues(t, outs[i], result)
assert.InDelta(t, outs[i], result, 1e-6)

result, _, err = p.Get(testStructJSONPtr)
require.NoError(t, err)
assert.EqualValues(t, outs[i], result)
assert.InDelta(t, outs[i], result, 1e-6)
}
}

Expand Down

0 comments on commit 8e6deda

Please sign in to comment.