[BUG][GO] Generated API Imports Deprecated io/ioutil Package
Created by: gonzogomez
Description
The generator will generate the following go code with the deprecated io/ioutil package:
import (
"bytes"
"context"
"io/ioutil"
"net/http"
"net/url"
"strings"
"os"
)
io/ioutil package has been deprecated as of Go 1.16, the same functionality is now provided by the io and os packages.
openapi-generator version
Version tested :
- 6.2.1
- master
OpenAPI declaration file content or url
Command line used for generation
./run-in-docker.sh generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g go -o /gen/out/go-petstore -p packageName=petstore
Steps to reproduce
Generate the go code with petstore.yaml
./run-in-docker.sh generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g go -o /gen/out/go-petstore -p packageName=petstore
Suggest a fix/enhancement
Modify the following mustache template files to use io
and os
instead of io/ioutil
- api.ustache
- client.mustache
- signing.mustache