Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
brianshih1 committed Apr 21, 2024
1 parent 18022e6 commit aad5da5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func Unmarshal(schema Schema, data []byte, v any) error {
return DefaultConfig.Unmarshal(schema, data, v)
}

// Whether the decoder's reader has reached EOF.
func (d *Decoder) IsEof() bool {
return d.r.Error == io.EOF
// IsEOF returns Whether the decoder's reader has reached EOF.
func (d *Decoder) IsEOF() bool {
return errors.Is(d.r.Error, io.EOF)
}
2 changes: 1 addition & 1 deletion decoder_array_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ func TestDecoder_ArrayEof(t *testing.T) {

var got []bool
err = dec.Decode(&got)
assert.True(t, dec.IsEof())
assert.True(t, dec.IsEOF())
assert.NoError(t, err)
}
2 changes: 1 addition & 1 deletion decoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func TestDecoder_DecodeEOFDoesntReturnError(t *testing.T) {
err := dec.Decode(&i)

assert.NoError(t, err)
assert.True(t, dec.IsEof())
assert.True(t, dec.IsEOF())
}

func TestUnmarshal(t *testing.T) {
Expand Down

0 comments on commit aad5da5

Please sign in to comment.