-
Notifications
You must be signed in to change notification settings - Fork 9
/
string.go
70 lines (61 loc) · 1.45 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Code generated by "stringer -type=Duplex,Port -output=string.go"; DO NOT EDIT.
package ethtool
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[Half-0]
_ = x[Full-1]
_ = x[Unknown-255]
}
const (
_Duplex_name_0 = "HalfFull"
_Duplex_name_1 = "Unknown"
)
var (
_Duplex_index_0 = [...]uint8{0, 4, 8}
)
func (i Duplex) String() string {
switch {
case 0 <= i && i <= 1:
return _Duplex_name_0[_Duplex_index_0[i]:_Duplex_index_0[i+1]]
case i == 255:
return _Duplex_name_1
default:
return "Duplex(" + strconv.FormatInt(int64(i), 10) + ")"
}
}
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[TwistedPair-0]
_ = x[AUI-1]
_ = x[MII-2]
_ = x[Fibre-3]
_ = x[BNC-4]
_ = x[DirectAttach-5]
_ = x[None-239]
_ = x[Other-255]
}
const (
_Port_name_0 = "TwistedPairAUIMIIFibreBNCDirectAttach"
_Port_name_1 = "None"
_Port_name_2 = "Other"
)
var (
_Port_index_0 = [...]uint8{0, 11, 14, 17, 22, 25, 37}
)
func (i Port) String() string {
switch {
case 0 <= i && i <= 5:
return _Port_name_0[_Port_index_0[i]:_Port_index_0[i+1]]
case i == 239:
return _Port_name_1
case i == 255:
return _Port_name_2
default:
return "Port(" + strconv.FormatInt(int64(i), 10) + ")"
}
}