Skip to content
masterclass Buddy

Go · Interface

fmt.Stringer

stringer generates String methods for named integer types with constants. The methods return constant names, so values print through fmt.Stringer.

Last updated

Syntax

stringer [flags] [directory | files]

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

Subscribe
  • fmt.Stringer
  • go generate
  • -type
  • -output
  • -linecomment
  • -trimprefix

Source: stringer command - golang.org/x/tools/cmd/stringer - Go Packages. Checked 2026-11-03.