Documentation ¶
Index ¶
- func LazyReadCloser(open func() (io.ReadCloser, error)) io.ReadCloser
- func LazyWriteCloser(open func() (io.WriteCloser, error)) io.WriteCloser
- func NewEmptySkipper(open func() (io.Writer, error)) io.WriteCloser
- func NormalizeFileMode(mode os.FileMode) os.FileMode
- func SameSkipper(r io.Reader, open func() (io.WriteCloser, error)) io.WriteCloser
- type NopCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LazyReadCloser ¶
func LazyReadCloser(open func() (io.ReadCloser, error)) io.ReadCloser
LazyReadCloser provides an interface to a ReadCloser that will open on the first access. The wrapped io.ReadCloser must be provided by 'open'.
func LazyWriteCloser ¶
func LazyWriteCloser(open func() (io.WriteCloser, error)) io.WriteCloser
LazyWriteCloser provides an interface to a WriteCloser that will open on the first access. The wrapped io.WriteCloser must be provided by 'open'.
func NewEmptySkipper ¶
func NewEmptySkipper(open func() (io.Writer, error)) io.WriteCloser
NewEmptySkipper creates an io.WriteCloser that will only start writing once a non-whitespace byte has been encountered. The wrapped io.WriteCloser must be provided by the `open` func.
func NormalizeFileMode ¶ added in v3.10.0
NormalizeFileMode converts the given mode to a mode that will work as expected on the given OS. A no-op on non-Windows OSes, but on Windows modes work differently - only the owner read/write bits are honoured (i.e. the 0200 mask).
func SameSkipper ¶
func SameSkipper(r io.Reader, open func() (io.WriteCloser, error)) io.WriteCloser
SameSkipper creates an io.WriteCloser that will only start writing once a difference with the current output has been encountered. The wrapped io.WriteCloser must be provided by 'open'.