()
| 27 | } |
| 28 | |
| 29 | func (s Status) Action() string { |
| 30 | switch s { |
| 31 | case OpenStatus: |
| 32 | return "opened" |
| 33 | case ClosedStatus: |
| 34 | return "closed" |
| 35 | default: |
| 36 | return "unknown status" |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | func StatusFromString(str string) (Status, error) { |
| 41 | cleaned := strings.ToLower(strings.TrimSpace(str)) |