github.com/benz9527/xboot@v0.0.0-20240504061247-c23f15593274/lib/tree/rbcolor_string.go (about) 1 // Code generated by "stringer -type=RBColor"; DO NOT EDIT. 2 3 package tree 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[Black-0] 12 _ = x[Red-1] 13 } 14 15 const _RBColor_name = "BlackRed" 16 17 var _RBColor_index = [...]uint8{0, 5, 8} 18 19 func (i RBColor) String() string { 20 if i >= RBColor(len(_RBColor_index)-1) { 21 return "RBColor(" + strconv.FormatInt(int64(i), 10) + ")" 22 } 23 return _RBColor_name[_RBColor_index[i]:_RBColor_index[i+1]] 24 }