-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpowereventcode_string.go
More file actions
42 lines (36 loc) · 1.07 KB
/
powereventcode_string.go
File metadata and controls
42 lines (36 loc) · 1.07 KB
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
// Code generated by "stringer -type=PowerEventCode"; DO NOT EDIT.
package golibevdev
import "strconv"
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[PwrName-0]
_ = x[PwrSerial-1]
_ = x[PwrCapacity-2]
_ = x[PwrStatus-3]
_ = x[PwrPresent-4]
_ = x[PwrReserved-5]
_ = x[PwrCycle-6]
_ = x[PwrMax-15]
_ = x[PwrCnt-16]
}
const (
_PowerEventCode_name_0 = "PwrNamePwrSerialPwrCapacityPwrStatusPwrPresentPwrReservedPwrCycle"
_PowerEventCode_name_1 = "PwrMaxPwrCnt"
)
var (
_PowerEventCode_index_0 = [...]uint8{0, 7, 16, 27, 36, 46, 57, 65}
_PowerEventCode_index_1 = [...]uint8{0, 6, 12}
)
func (i PowerEventCode) String() string {
switch {
case i <= 6:
return _PowerEventCode_name_0[_PowerEventCode_index_0[i]:_PowerEventCode_index_0[i+1]]
case 15 <= i && i <= 16:
i -= 15
return _PowerEventCode_name_1[_PowerEventCode_index_1[i]:_PowerEventCode_index_1[i+1]]
default:
return "PowerEventCode(" + strconv.FormatInt(int64(i), 10) + ")"
}
}