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

Function ParseAllNegative

example/negative_enum.go:67–76  ·  view source on GitHub ↗

ParseAllNegative attempts to convert a string to a AllNegative.

(name string)

Source from the content-addressed store, hash-verified

65
66// ParseAllNegative attempts to convert a string to a AllNegative.
67func 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
78const (
79 // StatusUnknown is a Status of type Unknown.

Callers 1

TestNegativeStringFunction · 0.85

Calls 1

AllNegativeTypeAlias · 0.85

Tested by 1

TestNegativeStringFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…