parseArtifactURLs reads every argument as an artifact URL on the same issue.
(args []string)
| 145 | // parseArtifactURLs reads every argument as an artifact URL on the same |
| 146 | // issue. |
| 147 | func parseArtifactURLs(args []string) (int, func() (ghrepo.Interface, error), []int, error) { |
| 148 | var repo ghrepo.Interface |
| 149 | var issueNumber int |
| 150 | numbers := make([]int, 0, len(args)) |
| 151 | for _, arg := range args { |
| 152 | r, issue, number, err := parseArtifactURL(arg) |
| 153 | if err != nil { |
| 154 | return 0, nil, nil, err |
| 155 | } |
| 156 | if repo == nil { |
| 157 | repo, issueNumber = r, issue |
| 158 | } else if issue != issueNumber || !ghrepo.IsSame(r, repo) { |
| 159 | return 0, nil, nil, errors.New("artifact URLs must all be on the same issue") |
| 160 | } |
| 161 | if numbers, err = appendNew(numbers, number); err != nil { |
| 162 | return 0, nil, nil, err |
| 163 | } |
| 164 | } |
| 165 | return issueNumber, func() (ghrepo.Interface, error) { return repo, nil }, numbers, nil |
| 166 | } |
| 167 | |
| 168 | // parseArtifactURL reads an artifact URL into its repository, issue number |
| 169 | // and artifact number. Like an issue URL, it may be http, and its query and |
no test coverage detected