(arg string)
| 54 | } |
| 55 | |
| 56 | func ParseIssueFromArg(arg string) (int, o.Option[ghrepo.Interface], error) { |
| 57 | issueLocator := tryParseIssueFromURL(arg) |
| 58 | if issueLocator, present := issueLocator.Value(); present { |
| 59 | return issueLocator.issueNumber, o.Some(issueLocator.repo), nil |
| 60 | } |
| 61 | |
| 62 | issueNumber, err := strconv.Atoi(strings.TrimPrefix(arg, "#")) |
| 63 | if err != nil { |
| 64 | return 0, o.None[ghrepo.Interface](), fmt.Errorf("invalid issue format: %q", arg) |
| 65 | } |
| 66 | |
| 67 | return issueNumber, o.None[ghrepo.Interface](), nil |
| 68 | } |
| 69 | |
| 70 | type issueLocator struct { |
| 71 | issueNumber int |
no test coverage detected