lineread

package
v1.75.0-pre Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: BSD-3-Clause Imports: 3 Imported by: 20

Documentation

Overview

Package lineread reads lines from files. It's not fancy, but it got repetitive.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func File

func File(name string, fn func(line []byte) error) error

File opens name and calls fn for each line. It returns an error if the Open failed or once fn returns an error.

func Reader

func Reader(r io.Reader, fn func(line []byte) error) error

Reader calls fn for each line. If fn returns an error, Reader stops reading and returns that error. Reader may also return errors encountered reading and parsing from r. To stop reading early, use a sentinel "stop" error value and ignore it when returned from Reader.

Types

This section is empty.

Jump to

Keyboard shortcuts

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