/
learntype_string.go
40 lines (32 loc) · 1014 Bytes
/
learntype_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
// Code generated by "stringer -type=LearnType"; DO NOT EDIT.
package main
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[Hebbian-0]
_ = x[ErrorDriven-1]
_ = x[LearnTypeN-2]
}
const _LearnType_name = "HebbianErrorDrivenLearnTypeN"
var _LearnType_index = [...]uint8{0, 7, 18, 28}
func (i LearnType) String() string {
if i < 0 || i >= LearnType(len(_LearnType_index)-1) {
return "LearnType(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _LearnType_name[_LearnType_index[i]:_LearnType_index[i+1]]
}
func (i *LearnType) FromString(s string) error {
for j := 0; j < len(_LearnType_index)-1; j++ {
if s == _LearnType_name[_LearnType_index[j]:_LearnType_index[j+1]] {
*i = LearnType(j)
return nil
}
}
return errors.New("String: " + s + " is not a valid option for type: LearnType")
}