Skip to content

Commit

Permalink
[FIXED] Add missing nats prefix to error
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrpio committed Dec 17, 2024
1 parent 074c819 commit 48c92c8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions jetstream/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ type (
err error
ctx context.Context
digest hash.Hash
cursor uint64
}
)

Expand Down Expand Up @@ -1488,6 +1489,27 @@ func (o *objResult) Close() error {
return o.r.Close()
}

func (o *objResult) Seek(offset int64, whence int) (int64, error) {
o.Lock()
defer o.Unlock()
if o.r == nil {
return 0, io.EOF
}

o.r.Read()

Check failure on line 1499 in jetstream/object.go

View workflow job for this annotation

GitHub Actions / lint

not enough arguments in call to o.r.Read

Check failure on line 1499 in jetstream/object.go

View workflow job for this annotation

GitHub Actions / test (1.22)

not enough arguments in call to o.r.Read

Check failure on line 1499 in jetstream/object.go

View workflow job for this annotation

GitHub Actions / test (1.23)

not enough arguments in call to o.r.Read
seeker, ok := o.r.(io.Seeker)
if !ok {
return 0, errors.New("underlying reader does not support seeking")
}

newOffset, err := seeker.Seek(offset, whence)
if err != nil {
return 0, err
}

return newOffset, nil
}

func (o *objResult) setErr(err error) {
o.Lock()
defer o.Unlock()
Expand Down

0 comments on commit 48c92c8

Please sign in to comment.