Writer

Noun · Development

Definitions

  1. An abstraction or interface — such as Go's io.Writer or Java's java.io.Writer — that represents a destination to which bytes or characters can be sequentially written, decoupling the producing code from the specific output target (file, socket, buffer, etc.).

    In plain English: A standardized way for code to send data to any output — a file, the screen, a network connection — without knowing which one it is.

    Example: "Just accept an io.Writer so we can swap between writing to a file and writing to stdout in tests."

Related Terms