diff --git a/cmd/docs/cmd_sync.go b/cmd/docs/cmd_sync.go index d05c25f..72db260 100644 --- a/cmd/docs/cmd_sync.go +++ b/cmd/docs/cmd_sync.go @@ -350,7 +350,7 @@ func resetOutputDir(dir string) error { // goHelpOutputName maps repo name to output folder name for go-help. func goHelpOutputName(repoName string) string { if repoName == "core" { - return "cli" + return "go" } if strings.HasPrefix(repoName, "core-") { return strings.TrimPrefix(repoName, "core-") diff --git a/cmd/docs/cmd_sync_test.go b/cmd/docs/cmd_sync_test.go index d28ef5c..bfde4d7 100644 --- a/cmd/docs/cmd_sync_test.go +++ b/cmd/docs/cmd_sync_test.go @@ -62,3 +62,19 @@ func TestResetOutputDir_ClearsExistingFiles(t *testing.T) { t.Fatalf("expected output dir to exist as a directory") } } + +func TestGoHelpOutputName_Good(t *testing.T) { + cases := map[string]string{ + "core": "go", + "core-admin": "admin", + "core-api": "api", + "go-example": "go-example", + "custom-repo": "custom-repo", + } + + for input, want := range cases { + if got := goHelpOutputName(input); got != want { + t.Fatalf("goHelpOutputName(%q) = %q, want %q", input, got, want) + } + } +}