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

Function ParseProduct

example/custom_prefix_enum.go:58–63  ·  view source on GitHub ↗

ParseProduct attempts to convert a string to a Product.

(name string)

Source from the content-addressed store, hash-verified

56
57// ParseProduct attempts to convert a string to a Product.
58func ParseProduct(name string) (Product, error) {
59 if x, ok := _ProductValue[name]; ok {
60 return x, nil
61 }
62 return Product(0), fmt.Errorf("%s is %w", name, ErrInvalidProduct)
63}

Callers 1

TestProductStringFunction · 0.85

Calls 1

ProductTypeAlias · 0.85

Tested by 1

TestProductStringFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…