bufioutil

package
v0.0.0-...-2c87074 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Unlicense Imports: 3 Imported by: 4

Documentation

Overview

Package bufioutil implements utility functions for buffered I/O.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadLines

func LoadLines(filePath string) (lines []string, err error)

LoadLines loads the provided file and returns all lines, not including the end-of-line bytes.

func ReadLines

func ReadLines(r io.Reader) (lines []string, err error)

ReadLines reads from r and returns all lines, not including the end-of-line bytes.

Types

type Reader

type Reader struct {
	*bufio.Reader
}

Reader implements buffering for an io.Reader object.

func NewReader

func NewReader(r io.Reader) (br Reader)

NewReader returns a new Reader.

func (Reader) ReadLine

func (br Reader) ReadLine() (line string, err error)

ReadLine reads returns a single line from br, not including the end-of-line bytes.

func (Reader) ReadLines

func (br Reader) ReadLines() (lines []string, err error)

ReadLines reads and returns all lines from br, not including the end-of-line bytes.

type Writer

type Writer struct {
	*bufio.Writer
}

Writer implements buffering for an io.Writer object.

func NewWriter

func NewWriter(r io.Writer) (br Writer)

NewWriter returns a new Writer.

func (Writer) WriteLine

func (bw Writer) WriteLine(str string) (i int, err error)

WriteLine writes a single line, including an newline character.

Jump to

Keyboard shortcuts

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