Skip to content

Commit

Permalink
added a first proper readme
Browse files Browse the repository at this point in the history
  • Loading branch information
philiplb committed Sep 26, 2020
1 parent 7448ec8 commit 96e3dd0
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
# peek-a-buf
# Peek-A-Buf

Peek-A-Buf is a Go library for a buffered reader with side effect free peeking capability.

At the moment, a buffered reader for runes is implemented meant for things like scanners.

Why is this useful if `bufio.Reader` exists? Well, the Peek function is sadly not side effect
free there:

> Calling Peek prevents a UnreadByte or UnreadRune call from succeeding until the next read
> operation.
But this was something needed to fix a bug in the
[SQLDumpSplitter3](https://philiplb.de/sqldumpsplitter3). So I created this little library
basically wrapping `bufio.Reader` and re-implementing small parts of it.

In addition to the side effect free peek function, it returns an `EOF` rune instead of an
error if it reaches the end of the buffer.

Have a look at the **[documentation](https://godoc.org/github.com/philiplb/peekabuf)**.

## Installation

Just `go get` it:

```bash
go get github.com/philiplb/peekabuf
```

## License
[MIT](https://choosealicense.com/licenses/mit/)

0 comments on commit 96e3dd0

Please sign in to comment.