io

package
v0.0.0-...-24ca9bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultHeadLength int = 5

	ReplacementChar rune = unicode.ReplacementChar
)

Functions

func ByteHead

func ByteHead()

func CloseReaderIf

func CloseReaderIf(r io.Reader) error

CloseReaderIf checks a reader to see if it also has a close method. If so, it calls r.Close(). Useful for places where any io.Reader can be used, but a file (or other ReadCloser that requires closing) may be substituted.

func CloseWriterIf

func CloseWriterIf(w io.Writer) error

CloseWriterIf checks a writer to see if it also has a close method. If so, it calls r.Close(). Useful for places where any io.Writer can be used, but a file (or other WriteCloser that requires closing) may be substituted.

func FprintGzip

func FprintGzip(w io.Writer, r io.Reader) (n int64, err error)
func Head(r io.Reader, n int) ([]byte, error)

Head returns an io.Reader that always returns the first n lines of a source reader

func PrintGzip

func PrintGzip(r io.Reader) (n int64, err error)

func ReadCloser

func ReadCloser(filename string) (io.ReadCloser, error)

ReadCloser returns an io.ReadCloser from a file. The caller is responsible for closing the file when finished with it.

func ReadGzip

func ReadGzip(dst io.Writer, src io.Reader) (n int64, err error)

Types

This section is empty.

Directories

Path Synopsis
examples
comments
Sample comment reader.
Sample comment reader.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL