[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.