From 57a39b2816a84d8b4e3b942551cc4d390ceaf287 Mon Sep 17 00:00:00 2001 From: Albinanto Christian Date: Mon, 17 Feb 2025 12:09:43 +0700 Subject: [PATCH] Replace package `io/ioutil` with `io`. Package `io/ioutio` is deprecated as of Go 1.16, the same functionality is provided by package `io` --- src/main/resources/handlebars/go/api.mustache | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/handlebars/go/api.mustache b/src/main/resources/handlebars/go/api.mustache index 0b571ee575..abfa472c01 100644 --- a/src/main/resources/handlebars/go/api.mustache +++ b/src/main/resources/handlebars/go/api.mustache @@ -5,7 +5,7 @@ package {{packageName}} {{#operations}} import ( "context" - "io/ioutil" + "io" "net/http" "net/url" "strings" @@ -178,7 +178,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} } {{/required}} if localVarFile != nil { - fbs, _ := ioutil.ReadAll(localVarFile) + fbs, _ := io.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() @@ -237,7 +237,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, err } - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarBody, err := io.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, err