ParseAnimal attempts to convert a string to a Animal.
(name string)
| 64 | |
| 65 | // ParseAnimal attempts to convert a string to a Animal. |
| 66 | func ParseAnimal(name string) (Animal, error) { |
| 67 | if x, ok := _AnimalValue[name]; ok { |
| 68 | return x, nil |
| 69 | } |
| 70 | return Animal(0), fmt.Errorf("%s is %w", name, ErrInvalidAnimal) |
| 71 | } |
searching dependent graphs…