Skip to content

Commit b5a8f91

Browse files
committed
Enhance package error message for gen go
1 parent ecc6178 commit b5a8f91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/codegen/golang/gen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ func generate(req *plugin.GenerateRequest, options *opts.Options, enums []Enum,
253253
code, err := format.Source(b.Bytes())
254254
if err != nil {
255255
fmt.Println(b.String())
256-
return fmt.Errorf("source error: %w", err)
256+
return fmt.Errorf("source error %s: %w\nHint: Check your sqlc.yml 'gen.go.package' and 'gen.go.out' fields", name, err)
257257
}
258258

259259
if templateName == "queryFile" && options.OutputFilesSuffix != "" {

0 commit comments

Comments
 (0)