Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #13632
Closed
Open
Issue created Oct 07, 2022 by Administrator@rootContributor

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

Created by: maelick

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/staticcheck@2022.1
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.

Assignee
Assign to
Time tracking