blob: d2c39847fff365380852a703993f21a4a8e2f9bc [file] [log] [blame]
// +build ignore,OMIT
package main
import "fmt"
// type START OMIT
type Weekday int
// type END OMIT
const (
Mon Weekday = iota
Tue
Wed
Thu
Fri
Sat
Sun
)
var names = [...]string{"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}
// String START OMIT
func (d Weekday) String() string { // ...
// String END OMIT
return names[d]
}
// main START OMIT
func main() {
fmt.Println(Mon.String())
fmt.Println()
for d := Mon; d <= Sun; d++ {
fmt.Println(d.String())
}
}
// main END OMIT