enumer/examples/gomods/main.go

21 lines
300 B
Go
Raw Normal View History

2019-04-08 09:56:38 +03:00
package main
import "fmt"
//go:generate go run github.com/dmarkham/enumer -type=Pill -json
type Pill int
const (
Placebo Pill = iota
Aspirin
Ibuprofen
Paracetamol
Acetaminophen = Paracetamol
)
func main() {
fmt.Println(PillStrings())
fmt.Println(Placebo.IsAPill())
fmt.Println(Placebo)
}