Skip to content

Commit

Permalink
refactor(pkg/codegen): add goCode to error (#599)
Browse files Browse the repository at this point in the history
  • Loading branch information
sashamelentyev committed May 31, 2022
1 parent 313aa80 commit 65507ca
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/codegen/codegen.go
Expand Up @@ -294,8 +294,7 @@ func Generate(spec *openapi3.T, opts Configuration) (string, error) {

outBytes, err := imports.Process(opts.PackageName+".go", []byte(goCode), nil)
if err != nil {
fmt.Println(goCode)
return "", fmt.Errorf("error formatting Go code: %w", err)
return "", fmt.Errorf("error formatting Go code %s: %w", goCode, err)
}
return string(outBytes), nil
}
Expand Down

0 comments on commit 65507ca

Please sign in to comment.