← All notes

Go bufio: buffered readers, writers, and scanners

Answer: Package bufio implements buffered I/O for readers and writers. Scanner is a convenient API for reading data such as lines.

Examples

package main
import (
    "bufio"
    "os"
)

func main() {
    s := bufio.NewScanner(os.Stdin)
    for s.Scan() {
        _ = s.Text()
    }
}

Notes

Reference list

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Go docs, bufio package; Go source, bufio.go. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Go docs, bufio package; Go source, bufio.go. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors.

Cite this

Permanent ID: iil:note:fre530dv

iinventedlight. 2026. "Go bufio: buffered readers, writers, and scanners." iinventedlight Library, iil:note:fre530dv, version of 2026-11-18. https://iinventedlight.com/library/notes/go-bufio/. License: CC-BY-4.0.

@misc{iil_note_fre530dv,
  author = {{iinventedlight}},
  title = {{Go bufio: buffered readers, writers, and scanners}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-18},
  url = {https://iinventedlight.com/library/notes/go-bufio/},
  note = {Permanent ID iil:note:fre530dv. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/go-bufio.md.