Skip to content

Commit 9f99f80

Browse files
author
Andreas Auernhammer
committed
replace type of negative-offset error
This commit replaces the type of the error returned by `ReadAt` when the offset is negative.
1 parent ed0d44b commit 9f99f80

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

reader.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package sio
77
import (
88
"crypto/cipher"
99
"encoding/binary"
10-
"errors"
1110
"io"
1211
"io/ioutil"
1312
"math"
@@ -462,7 +461,7 @@ type DecReaderAt struct {
462461
// a misbehaving producer of encrypted data.
463462
func (r *DecReaderAt) ReadAt(p []byte, offset int64) (int, error) {
464463
if offset < 0 {
465-
return 0, errors.New("sio: DecReaderAt.ReadAt: offset is negative")
464+
return 0, errorType("sio: DecReaderAt.ReadAt: offset is negative")
466465
}
467466

468467
t := offset / int64(r.bufSize)

0 commit comments

Comments
 (0)