github.com/kotovmak/go-admin@v1.1.1/template/types/table/table.go (about) 1 package table 2 3 type Type uint8 4 5 const ( 6 Text Type = iota 7 Textarea 8 Select 9 Date 10 Datetime 11 Year 12 Month 13 Day 14 Switch 15 ) 16 17 func (t Type) String() string { 18 switch t { 19 case Text: 20 return "text" 21 case Select: 22 return "select" 23 case Textarea: 24 return "textarea" 25 case Date: 26 return "date" 27 case Switch: 28 return "switch" 29 case Year: 30 return "year" 31 case Month: 32 return "month" 33 case Day: 34 return "day" 35 case Datetime: 36 return "datetime" 37 default: 38 panic("wrong form type") 39 } 40 } 41 42 func (t Type) IsSwitch() bool { 43 return t == Switch 44 }