Skip to content
masterclass Buddy

Go · Concept

Interface embedding

Interface embedding combines interfaces into a larger interface. Struct embedding reuses fields and promotes their methods, but it is not subclassing.

Last updated

Syntax

type Combined interface {
	First
	Second
}

type Outer struct {
	*Inner
}

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

Subscribe
  • Reader
  • Writer
  • ReadWriter
  • bufio.Reader
  • bufio.Writer

Source: Effective Go. Checked 2026-11-03.