ParseAllNegative attempts to convert a string to a AllNegative.
(name string)
| 65 | |
| 66 | // ParseAllNegative attempts to convert a string to a AllNegative. |
| 67 | func ParseAllNegative(name string) (AllNegative, error) { |
| 68 | if x, ok := _AllNegativeValue[name]; ok { |
| 69 | return x, nil |
| 70 | } |
| 71 | // Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to. |
| 72 | if x, ok := _AllNegativeValue[strings.ToLower(name)]; ok { |
| 73 | return x, nil |
| 74 | } |
| 75 | return AllNegative(0), fmt.Errorf("%s is %w", name, ErrInvalidAllNegative) |
| 76 | } |
| 77 | |
| 78 | const ( |
| 79 | // StatusUnknown is a Status of type Unknown. |
searching dependent graphs…