Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][go] ST1005 when running staticcheck on generated client code #13632

Closed
maelick opened this issue Oct 7, 2022 · 0 comments · Fixed by #13633
Closed

[BUG][go] ST1005 when running staticcheck on generated client code #13632

maelick opened this issue Oct 7, 2022 · 0 comments · Fixed by #13633

Comments

@maelick
Copy link
Contributor

maelick commented Oct 7, 2022

Bug Report Checklist

Description

When running staticcheck on the generated go client, there are several ST1005 errors.

openapi-generator version

Using openapitools/openapi-generator-cli:v6.1.0 but the problem persists in the mustache templates of latest master.

OpenAPI declaration file content or url
openapi: "3.0.3"
info:
  version: 1.0.0
  title: test
paths:
  /endpoint:
    get:
      responses:
        200:
          description: 'successful operation'
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
Generation Details
docker run --rm -v $(pwd):/local openapitools/openapi-generator-cli:v6.1.0 generate -i local/api.yaml -g go -o local/client --additional-properties=outputAsLibrary=true
Steps to reproduce

Run staticcheck on the generated code:

go install honnef.co/go/tools/cmd/[email protected]
cd client
staticcheck .
Related issues/PRs

I didn't find any issue/PR mentioning ST1005.

Suggest a fix

Update the mustache templates that do not follow the code style guidelines for fmt.Errorf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant