MCPcopy Index your code
hub / github.com/git-bug/git-bug / StatusFromString

Function StatusFromString

entities/common/status.go:40–51  ·  view source on GitHub ↗
(str string)

Source from the content-addressed store, hash-verified

38}
39
40func StatusFromString(str string) (Status, error) {
41 cleaned := strings.ToLower(strings.TrimSpace(str))
42
43 switch cleaned {
44 case "open":
45 return OpenStatus, nil
46 case "closed":
47 return ClosedStatus, nil
48 default:
49 return 0, fmt.Errorf("unknown status")
50 }
51}
52
53func (s Status) Validate() error {
54 if s != OpenStatus && s != ClosedStatus {

Callers 2

completeQueryFunction · 0.92
ParseFunction · 0.92

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected