all repos — searchix @ abf819db104560670cdc388a584d09968aac7bbb

Search engine for NixOS, nix-darwin, home-manager and NUR users

internal/fetcher/buf.go (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package fetcher

import (
	"bufio"
	"io"

	"gitlab.com/tozd/go/errors"
)

type Reader struct {
	closer io.ReadCloser
	*bufio.Reader
}

func NewReadCloser(body io.ReadCloser) *Reader {
	return &Reader{
		closer: body,
		Reader: bufio.NewReader(body),
	}
}

func (r *Reader) Close() error {
	return errors.WithStack(r.closer.Close())
}