Skip to content

Commit

Permalink
Include package names in error
Browse files Browse the repository at this point in the history
  • Loading branch information
hariso committed Apr 15, 2024
1 parent 22560fc commit 8fe5957
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion paramgen/internal/paramgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"unicode"

"github.com/conduitio/conduit-commons/config"
"golang.org/x/exp/maps"
)

const (
Expand Down Expand Up @@ -123,7 +124,7 @@ func parsePackage(path string) (*ast.Package, error) {
return nil, fmt.Errorf("no source-code package in directory %s", path)
}
if len(pkgs) > 1 {
return nil, fmt.Errorf("multiple packages in directory %s", path)
return nil, fmt.Errorf("multiple packages %v in directory %s", maps.Keys(pkgs), path)
}
for _, v := range pkgs {
return v, nil // return first package
Expand Down

0 comments on commit 8fe5957

Please sign in to comment.