Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReadInt and ReadLong eof #380

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
}

// ReadInt reads an Int from the Reader.
func (r *Reader) ReadInt() int32 {

Check failure on line 141 in reader.go

View workflow job for this annotation

GitHub Actions / test (1.21)

141-181 lines are duplicate of `reader.go:184-224` (dupl)
if r.Error != nil {
return 0
}
Expand Down Expand Up @@ -174,13 +174,14 @@
// We ran out of buffer and are not at the end of the int,
// Read more into the buffer.
if !r.loadMore() {
r.Error = fmt.Errorf("reading int %w", r.Error)
return 0
}
}
}

// ReadLong reads a Long from the Reader.
func (r *Reader) ReadLong() int64 {

Check failure on line 184 in reader.go

View workflow job for this annotation

GitHub Actions / test (1.21)

184-224 lines are duplicate of `reader.go:141-181` (dupl)
if r.Error != nil {
return 0
}
Expand Down Expand Up @@ -216,6 +217,7 @@
// We ran out of buffer and are not at the end of the long,
// Read more into the buffer.
if !r.loadMore() {
r.Error = fmt.Errorf("reading long %w", r.Error)
return 0
}
}
Expand Down
Loading