ParseJobState attempts to convert a string to a JobState.
(name string)
| 61 | |
| 62 | // ParseJobState attempts to convert a string to a JobState. |
| 63 | func 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 | |
| 70 | var errJobStateNilPtr = errors.New("value pointer is nil") // one per type for package clashes |
| 71 |
searching dependent graphs…