...
Run Format

Package bio

import "cmd/internal/bio"
Overview
Index

Overview ▾

Package bio implements common I/O abstractions used within the Go toolchain.

func MustClose

func MustClose(c io.Closer)

MustClose closes Closer c and calls log.Fatal if it returns a non-nil error.

func MustWriter

func MustWriter(w io.Writer) io.Writer

MustWriter returns a Writer that wraps the provided Writer, except that it calls log.Fatal instead of returning a non-nil error.

type Reader

Reader implements a seekable buffered io.Reader.

type Reader struct {
        *bufio.Reader
        // contains filtered or unexported fields
}

func Open

func Open(name string) (*Reader, error)

Open returns a Reader for the file named name.

func (*Reader) Close

func (r *Reader) Close() error

func (*Reader) Offset

func (r *Reader) Offset() int64

func (*Reader) Seek

func (r *Reader) Seek(offset int64, whence int) int64

type Writer

Writer implements a seekable buffered io.Writer.

type Writer struct {
        *bufio.Writer
        // contains filtered or unexported fields
}

func Create

func Create(name string) (*Writer, error)

Create creates the file named name and returns a Writer for that file.

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) Offset

func (w *Writer) Offset() int64

func (*Writer) Seek

func (w *Writer) Seek(offset int64, whence int) int64