dmitri.shuralyov.com/website/gido

Map "x" <-> "golang.org/x" symmetrically.

Previously, only "golang.org/x" -> "x" direction was done. Now it goes
both ways.

For consistency and simplicity.
dmitshur committed 6 years ago commit 688b8709c8c8759d7e98a327b16889d726b5bce1
Showing partial commit. Full Commit
Collapse all
service.go
@@ -243,11 +243,11 @@ func ParsePrefixedTitle(prefixedTitle string) (paths []string, title string) {
		return []string{prefix}, title
	}
	paths = strings.Split(prefix, ",")
	for i := range paths {
		paths[i] = strings.TrimSpace(paths[i])
		if strings.HasPrefix(paths[i], "x/") { // Map "x/..." to "golang.org/x/...".
		if strings.HasPrefix(paths[i], "x/") || paths[i] == "x" { // Map "x/..." to "golang.org/x/...".
			paths[i] = "golang.org/" + paths[i]
		}
	}
	return paths, title
}
service_test.go
@@ -27,10 +27,14 @@ func TestParsePrefixedTitle(t *testing.T) {
		},
		{ // "x/..." refers to "golang.org/x/...".
			in:        "x/path: Issue title.",
			wantPaths: []string{"golang.org/x/path"}, wantTitle: "Issue title.",
		},
		{ // "x" refers to "golang.org/x".
			in:        "x: Issue title.",
			wantPaths: []string{"golang.org/x"}, wantTitle: "Issue title.",
		},
		{ // Multiple comma-separated paths.
			in:        "path1, path2: Issue title.",
			wantPaths: []string{"path1", "path2"}, wantTitle: "Issue title.",
		},
		{ // No path prefix.