Skip to content

Commit

Permalink
Fix GetPeeker magic
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Mar 10, 2022
1 parent 3dcc3ab commit 4343a5f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions peeker.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ type BytePeeker interface {
}

func GetPeeker(r io.Reader) BytePeeker {
if r, ok := r.(*ReaderWithEOFContext); ok {
if r, ok := r.R.(BytePeeker); ok {
return r
}
}
if r, ok := r.(BytePeeker); ok {
return r
}
Expand Down

0 comments on commit 4343a5f

Please sign in to comment.