fix(docs): align gohelp repo mapping
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
93c8eef876
commit
c50257fa49
2 changed files with 17 additions and 1 deletions
|
|
@ -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-")
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue