Skip to content

Commit

Permalink
remove incomplete error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
letFunny committed Jul 10, 2024
1 parent b8f91bf commit 426ca94
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions internal/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ func parsePackage(baseDir, pkgName, pkgPath string, data []byte) (*Package, erro
pkgName, sliceName, contPath)
}
if _, err := validateGeneratePath(contPath); err != nil {
return nil, fmt.Errorf("slice %s_%s has %s", pkgName, sliceName, err)
return nil, fmt.Errorf("slice %s_%s has invalid generate path: %s", pkgName, sliceName, err)
}
kinds = append(kinds, GeneratePath)
} else if strings.ContainsAny(contPath, "*?") {
Expand Down Expand Up @@ -726,13 +726,7 @@ func parsePackage(baseDir, pkgName, pkgPath string, data []byte) (*Package, erro
//
// Wildcard characters can only appear at the end as **, and the path before
// those wildcards must be a directory.
func validateGeneratePath(path string) (dir string, err error) {
defer func() {
if err != nil {
err = fmt.Errorf("invalid generate path: %s", err)
}
}()

func validateGeneratePath(path string) (string, error) {
if !strings.HasSuffix(path, "/**") {
return "", fmt.Errorf("%s does not end with /**", path)
}
Expand Down

0 comments on commit 426ca94

Please sign in to comment.