@@ -27,10 +27,11 @@ import (
//
// "", "import/path: issue title" -> ["import/path"], "issue title"
// "", "proposal: path: issue title" -> ["path"], "issue title" # Proposal.
// "", "Proposal: path: issue title" -> ["path"], "issue title" # Proposal.
// "", "x/path: issue title" -> ["golang.org/x/path"], "issue title" # "x/..." refers to "golang.org/x/...".
// "", "dl/path: issue title" -> ["golang.org/dl/path"], "issue title" # "dl/..." refers to "golang.org/dl/...".
// "", "path1, path2: issue title" -> ["path1", "path2"], "issue title" # Multiple comma-separated paths.
// "mod", "import/path: issue title" -> ["mod/import/path"], "issue title"
// "mod", "path1, path2: issue title" -> ["mod/path1", "mod/path2"], "issue title" # Multiple comma-separated paths.
//
// If there's no path prefix (preceded by ": "), prefixedTitle is returned unmodified:
@@ -51,11 +52,14 @@ func ParseIssue(module, prefixedTitle string) (paths []string, title string) {
return []string{path.Join(module, strings.TrimSpace(prefix))}, title
}
paths = strings.Split(prefix, ",")
for i := range paths {
paths[i] = path.Join(module, strings.TrimSpace(paths[i]))
if strings.HasPrefix(paths[i], "x/") || paths[i] == "x" { // Map "x/..." to "golang.org/x/...".
switch {
case strings.HasPrefix(paths[i], "x/") || paths[i] == "x": // Map "x/..." to "golang.org/x/...".
paths[i] = "golang.org/" + paths[i]
case strings.HasPrefix(paths[i], "dl/") || paths[i] == "dl": // Map "dl/..." to "golang.org/dl/...".
paths[i] = "golang.org/" + paths[i]
}
}
return paths, title
}