Lesson 56 of 60
GoGenerating Go Code – `go generate` & Templates
20 minutes
Course progress93%
Code Generation
This lesson explains the main concept clearly with beginner-friendly examples and background so you can learn why the code works.
go generate runs commands specified in source files.
//go:generate stringer -type=Day
type Day int
const (
Sunday Day = iota
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
)