github.com/jordan-bonecutter/can-go@v0.0.0-20230901155856-d83995b18e50/pkg/socketcan/protocolviolationerror_string.go (about) 1 // Code generated by "stringer -type ProtocolViolationError -trimprefix ProtocolViolationError"; DO NOT EDIT. 2 3 package socketcan 4 5 import "strconv" 6 7 func _() { 8 // An "invalid array index" compiler error signifies that the constant values have changed. 9 // Re-run the stringer command to generate them again. 10 var x [1]struct{} 11 _ = x[ProtocolViolationErrorUnspecified-0] 12 _ = x[ProtocolViolationErrorSingleBit-1] 13 _ = x[ProtocolViolationErrorFrameFormat-2] 14 _ = x[ProtocolViolationErrorBitStuffing-4] 15 _ = x[ProtocolViolationErrorBit0-8] 16 _ = x[ProtocolViolationErrorBit1-16] 17 _ = x[ProtocolViolationErrorBusOverload-32] 18 _ = x[ProtocolViolationErrorActive-64] 19 _ = x[ProtocolViolationErrorTx-128] 20 } 21 22 const ( 23 _ProtocolViolationError_name_0 = "UnspecifiedSingleBitFrameFormat" 24 _ProtocolViolationError_name_1 = "BitStuffing" 25 _ProtocolViolationError_name_2 = "Bit0" 26 _ProtocolViolationError_name_3 = "Bit1" 27 _ProtocolViolationError_name_4 = "BusOverload" 28 _ProtocolViolationError_name_5 = "Active" 29 _ProtocolViolationError_name_6 = "Tx" 30 ) 31 32 var ( 33 _ProtocolViolationError_index_0 = [...]uint8{0, 11, 20, 31} 34 ) 35 36 func (i ProtocolViolationError) String() string { 37 switch { 38 case i <= 2: 39 return _ProtocolViolationError_name_0[_ProtocolViolationError_index_0[i]:_ProtocolViolationError_index_0[i+1]] 40 case i == 4: 41 return _ProtocolViolationError_name_1 42 case i == 8: 43 return _ProtocolViolationError_name_2 44 case i == 16: 45 return _ProtocolViolationError_name_3 46 case i == 32: 47 return _ProtocolViolationError_name_4 48 case i == 64: 49 return _ProtocolViolationError_name_5 50 case i == 128: 51 return _ProtocolViolationError_name_6 52 default: 53 return "ProtocolViolationError(" + strconv.FormatInt(int64(i), 10) + ")" 54 } 55 }