1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-13 08:03:17 +02:00

Docs and Matrix tests

This commit is contained in:
Philipp Heckel 2022-06-16 11:40:56 -04:00
parent 0ff8e968ca
commit 18bd3c0e55
12 changed files with 172 additions and 140 deletions

View file

@ -18,7 +18,8 @@ type PeekedReadCloser struct {
closed bool
}
// Peek reads the underlying ReadCloser into memory up until the limit and returns a PeekedReadCloser
// Peek reads the underlying ReadCloser into memory up until the limit and returns a PeekedReadCloser.
// It does not return an error if limit is reached. Instead, LimitReached will be set to true.
func Peek(underlying io.ReadCloser, limit int) (*PeekedReadCloser, error) {
if underlying == nil {
underlying = io.NopCloser(strings.NewReader(""))