Skip to content
masterclass Buddy

Go · Interface

io.Writer

Go interfaces describe behavior through methods. A value can be used through an interface when it provides the required methods, such as Read or Write.

Last updated

Syntax

type Reader interface { Read(p []byte) (n int, err error) }
type Writer interface { Write(p []byte) (n int, err error) }

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • io.Reader
  • io.Writer
  • bytes.Buffer
  • strings.Reader
  • io.MultiReader
  • io.MultiWriter

Source: Source file doc / progs / interface.go. Checked 2026-11-03.