Open Fjolnir-Dvorak opened 5 years ago
You can use file post-processing to format the code using your favorite code formatter.
Run ./bin/go-petstore.sh
and you will see the following output:
[main] INFO o.o.c.languages.AbstractGoCodegen - Environment variable GO_POST_PROCESS_FILE not defined so Go code may not be properly formatted. To define it, try `export GO_POST_PROCESS_FILE="/usr/local/bin/gofmt -w"` (Linux/Mac)
[main] INFO o.o.c.languages.AbstractGoCodegen - NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).
Bug Report Checklist
./samples/client/petstore/go/
Description
The generated code does not follow the go coding standards (go fmt)
openapi-generator version
commit c136b83bdb5e56ddb297de7f0d5bb9af447a9e54 (latest commit on master on 2019-10-02T15:27:00)
Steps to reproduce
Suggest a fix
Correct all mustache templates and add a test for the build servers which runs "go fmt" and checks if there are any changed files. If yes, the test should fail.