Standard library
I/O
Print strings to stdout, log, and stderr.
Introduction
Print strings to stdout, log, and stderr. Import std/io to bind the module as io. Call free functions as io.name(...). Struct methods use a receiver value.
/ std/io
This page is the package reference for std/io. Private helpers used only by co-located tests are not listed.
Functions
Free functions on io. Each function has a short description, an example, then parameters and return shape.
print
Writes value as text to standard output, followed by a newline. Call form: io.print(value).
/ std/io
io.print("hello")Parameters: value: string (or value rendered as text) to write. Returns: None.
log
Writes value to the log stream with a newline. Use for diagnostic lines separate from primary program output. Call form: io.log(value).
/ std/io
io.log("ready")Parameters: value: text to write to the log stream. Returns: None.
eprint
Writes value to standard error with a newline. Use for error messages that should stay off stdout. Call form: io.eprint(value).
/ std/io
io.eprint("failed")Parameters: value: text to write to stderr. Returns: None.