From 8fe595756f41d1882e232ca6ac19d31b62531fa1 Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Mon, 15 Apr 2024 17:25:00 +0200 Subject: [PATCH] Include package names in error --- paramgen/internal/paramgen.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paramgen/internal/paramgen.go b/paramgen/internal/paramgen.go index 638a1c1..3af7409 100644 --- a/paramgen/internal/paramgen.go +++ b/paramgen/internal/paramgen.go @@ -30,6 +30,7 @@ import ( "unicode" "github.com/conduitio/conduit-commons/config" + "golang.org/x/exp/maps" ) const ( @@ -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