/
eventpris_string.go
43 lines (35 loc) · 1.08 KB
/
eventpris_string.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Code generated by "stringer -type=EventPris"; DO NOT EDIT.
package gi
import (
"errors"
"strconv"
)
var _ = errors.New("dummy error")
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[HiPri-0]
_ = x[RegPri-1]
_ = x[LowPri-2]
_ = x[LowRawPri-3]
_ = x[EventPrisN-4]
_ = x[AllPris - -1]
}
const _EventPris_name = "AllPrisHiPriRegPriLowPriLowRawPriEventPrisN"
var _EventPris_index = [...]uint8{0, 7, 12, 18, 24, 33, 43}
func (i EventPris) String() string {
i -= -1
if i < 0 || i >= EventPris(len(_EventPris_index)-1) {
return "EventPris(" + strconv.FormatInt(int64(i+-1), 10) + ")"
}
return _EventPris_name[_EventPris_index[i]:_EventPris_index[i+1]]
}
func StringToEventPris(s string) (EventPris, error) {
for i := 0; i < len(_EventPris_index)-1; i++ {
if s == _EventPris_name[_EventPris_index[i]:_EventPris_index[i+1]] {
return EventPris(i + -1), nil
}
}
return 0, errors.New("String: " + s + " is not a valid option for type: EventPris")
}