Skip to content

Commit

Permalink
Include package names in error (#36)
Browse files Browse the repository at this point in the history
* Include package names in error

* go mod tidy

---------

Co-authored-by: Lovro Mažgon <[email protected]>
  • Loading branch information
hariso and lovromazgon authored Apr 16, 2024
1 parent 061d91a commit 3f77773
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/matryer/is v1.4.1
github.com/mitchellh/mapstructure v1.5.0
go.uber.org/goleak v1.3.0
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8
golang.org/x/tools v0.20.0
google.golang.org/protobuf v1.33.0
mvdan.cc/gofumpt v0.6.0
Expand Down Expand Up @@ -229,7 +230,6 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect
golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.24.0 // indirect
Expand Down
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 3f77773

Please sign in to comment.