github.com/goki/ki@v1.1.11/ki/nodesignals_string.go (about) 1 // Code generated by "stringer -type=NodeSignals"; DO NOT EDIT. 2 3 package ki 4 5 import ( 6 "errors" 7 "strconv" 8 ) 9 10 var _ = errors.New("dummy error") 11 12 func _() { 13 // An "invalid array index" compiler error signifies that the constant values have changed. 14 // Re-run the stringer command to generate them again. 15 var x [1]struct{} 16 _ = x[NodeSignalNil-0] 17 _ = x[NodeSignalUpdated-1] 18 _ = x[NodeSignalDeleting-2] 19 _ = x[NodeSignalsN-3] 20 } 21 22 const _NodeSignals_name = "NodeSignalNilNodeSignalUpdatedNodeSignalDeletingNodeSignalsN" 23 24 var _NodeSignals_index = [...]uint8{0, 13, 30, 48, 60} 25 26 func (i NodeSignals) String() string { 27 if i < 0 || i >= NodeSignals(len(_NodeSignals_index)-1) { 28 return "NodeSignals(" + strconv.FormatInt(int64(i), 10) + ")" 29 } 30 return _NodeSignals_name[_NodeSignals_index[i]:_NodeSignals_index[i+1]] 31 } 32 33 func (i *NodeSignals) FromString(s string) error { 34 for j := 0; j < len(_NodeSignals_index)-1; j++ { 35 if s == _NodeSignals_name[_NodeSignals_index[j]:_NodeSignals_index[j+1]] { 36 *i = NodeSignals(j) 37 return nil 38 } 39 } 40 return errors.New("String: " + s + " is not a valid option for type: NodeSignals") 41 }