oapi-codegen icon indicating copy to clipboard operation
oapi-codegen copied to clipboard

Newline missing after many errors printed by oapi-codegen command

Open nandedamana opened this issue 2 years ago • 0 comments

The oapi-codegen command does not print a newline after some error messages. Here is an example:

nandakumar@nandakumar-laptop:~/git/oapi-codegen/cmd/oapi-codegen$ oapi-codegen api.yml
configuration error: package name must be specifiednandakumar@nandakumar-laptop:~/git/oapi-codegen/cmd/oapi-codegen$ 

Expected:

nandakumar@nandakumar-laptop:~/git/oapi-codegen/cmd/oapi-codegen$ oapi-codegen api.yml
configuration error: package name must be specified
nandakumar@nandakumar-laptop:~/git/oapi-codegen/cmd/oapi-codegen$ 

But the program does print newline after some other errors:

nandakumar@nandakumar-laptop:~/git/oapi-codegen/cmd/oapi-codegen$ oapi-codegen
Please specify a path to a OpenAPI 3.0 spec file
nandakumar@nandakumar-laptop:~/git/oapi-codegen/cmd/oapi-codegen$

The problem has been identified and is with the usage of errExit(). This function doesn't append a newline, while some calling statements do and some others don't.

nandedamana avatar Sep 23 '22 08:09 nandedamana