Skip to content

Commit

Permalink
Fix package name generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy Baukema committed Feb 24, 2023
1 parent 27a65fc commit 558c27d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,7 @@ func pkg(goModPath string, mainFile string, tempWorkDir string, parentDir string
}
// Turn /path/to/module/cmd/main.go into cmd-main
// TODO: use allow-list instead of deny-list
relativeMainPath := filepath.Dir(mainFile)
relativeMainPath = relativeMainPath[len(goModDir):]
relativeMainPath := strings.TrimSuffix(mainFile[len(goModDir)+1:], ".go")
cmdSlug := "_"
cmdSlug += strings.ReplaceAll(relativeMainPath, "\\", "--")
cmdSlug = strings.ReplaceAll(cmdSlug, "/", "--")
Expand Down

0 comments on commit 558c27d

Please sign in to comment.