liveBook · Manning

Bufio

bufio is Go’s standard-library package providing buffered input and output wrappers and utilities for incrementally processing streams.

How 2 Manning books explain it

Go in Action, Second Edition

bufio is Go's standard library package for buffered input and output, including scanner-based tokenization.

How it is used
Buffers file, network, and stream I/O while supporting line-oriented reading, tokenization, look-ahead, and efficient output.
How deep it goes
Explains buffering, system-call reduction, core types, line reads, peeking, writing, error handling, and flushing.
Examples
Demonstrates line scanning, input-format detection with Peek, buffered writing, and JSON/XML conversion.
What you can do after
Operate buffered readers and writers, process input incrementally, inspect prefixes, handle EOF, and flush output correctly.

Read how Go in Action, Second Edition explains bufio →

Go in Practice, Second Edition

The Go bufio package provides buffered input and output wrappers and utilities for processing streams incrementally.

How it is used
Processes large, line-delimited files incrementally through buffered scanning instead of reading complete contents at once.
How deep it goes
Demonstrates Scanner and ScanLines in runnable code, while deferring deeper optimization and distributed processing.
Examples
Uses a structured.log file containing newline-delimited JSON records and extracts each record's level.
What you can do after
Build line-oriented Go processors that scan files incrementally and handle malformed records without stopping the entire stream.

Read how Go in Practice, Second Edition explains bufio →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.