-
Notifications
You must be signed in to change notification settings - Fork 0
/
prjntype_string.go
41 lines (33 loc) · 1.02 KB
/
prjntype_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
// Code generated by "stringer -type=PrjnType"; DO NOT EDIT.
package deep
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[BurstCtxt_-4]
_ = x[BurstTRC_-5]
_ = x[DeepAttn_-6]
_ = x[PrjnTypeN-7]
}
const _PrjnType_name = "BurstCtxt_BurstTRC_DeepAttn_PrjnTypeN"
var _PrjnType_index = [...]uint8{0, 10, 19, 28, 37}
func (i PrjnType) String() string {
i -= 4
if i < 0 || i >= PrjnType(len(_PrjnType_index)-1) {
return "PrjnType(" + strconv.FormatInt(int64(i+4), 10) + ")"
}
return _PrjnType_name[_PrjnType_index[i]:_PrjnType_index[i+1]]
}
func StringToPrjnType(s string) (PrjnType, error) {
for i := 0; i < len(_PrjnType_index)-1; i++ {
if s == _PrjnType_name[_PrjnType_index[i]:_PrjnType_index[i+1]] {
return PrjnType(i + 4), nil
}
}
return 0, errors.New("String: " + s + " is not a valid option for type: PrjnType")
}