...
1 package unstable
2
3 import "fmt"
4
5
6 type Kind int
7
8 const (
9
10 Invalid Kind = iota
11 Comment
12 Key
13
14
15 Table
16 ArrayTable
17 KeyValue
18
19
20 Array
21 InlineTable
22
23
24 String
25 Bool
26 Float
27 Integer
28 LocalDate
29 LocalTime
30 LocalDateTime
31 DateTime
32 )
33
34
35 func (k Kind) String() string {
36 switch k {
37 case Invalid:
38 return "Invalid"
39 case Comment:
40 return "Comment"
41 case Key:
42 return "Key"
43 case Table:
44 return "Table"
45 case ArrayTable:
46 return "ArrayTable"
47 case KeyValue:
48 return "KeyValue"
49 case Array:
50 return "Array"
51 case InlineTable:
52 return "InlineTable"
53 case String:
54 return "String"
55 case Bool:
56 return "Bool"
57 case Float:
58 return "Float"
59 case Integer:
60 return "Integer"
61 case LocalDate:
62 return "LocalDate"
63 case LocalTime:
64 return "LocalTime"
65 case LocalDateTime:
66 return "LocalDateTime"
67 case DateTime:
68 return "DateTime"
69 }
70 panic(fmt.Errorf("Kind.String() not implemented for '%d'", k))
71 }
72
View as plain text