MCPcopy Create free account
hub / github.com/abice/go-enum / ParseAnimal

Function ParseAnimal

example/animal_enum.go:66–71  ·  view source on GitHub ↗

ParseAnimal attempts to convert a string to a Animal.

(name string)

Source from the content-addressed store, hash-verified

64
65// ParseAnimal attempts to convert a string to a Animal.
66func 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}

Callers 1

TestAnimalStringFunction · 0.85

Calls 1

AnimalTypeAlias · 0.70

Tested by 1

TestAnimalStringFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…