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

Function ParseJobState

example/sql_str_enum.go:63–68  ·  view source on GitHub ↗

ParseJobState attempts to convert a string to a JobState.

(name string)

Source from the content-addressed store, hash-verified

61
62// ParseJobState attempts to convert a string to a JobState.
63func ParseJobState(name string) (JobState, error) {
64 if x, ok := _JobStateValue[name]; ok {
65 return x, nil
66 }
67 return JobState(0), fmt.Errorf("%s is %w", name, ErrInvalidJobState)
68}
69
70var errJobStateNilPtr = errors.New("value pointer is nil") // one per type for package clashes
71

Callers 2

ScanMethod · 0.85
TestSQLStrExtrasFunction · 0.85

Calls 1

JobStateTypeAlias · 0.85

Tested by 1

TestSQLStrExtrasFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…