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

style: replaced deprecated io/ioutil package with proper implementations of … #1443

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .schema/openapi/templates/go/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package {{packageName}}
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
{{#imports}} "{{import}}"
Expand Down Expand Up @@ -243,7 +243,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class
}
{{/required}}
if localVarFile != nil {
fbs, _ := ioutil.ReadAll(localVarFile)
fbs, _ := io.ReadAll(localVarFile)
localVarFileBytes = fbs
localVarFileName = localVarFile.Name()
localVarFile.Close()
Expand Down Expand Up @@ -321,9 +321,9 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err
}

localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err
}
Expand Down
3 changes: 1 addition & 2 deletions .schema/openapi/templates/go/signing.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"encoding/pem"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/textproto"
"os"
Expand Down Expand Up @@ -178,7 +177,7 @@ func (h *HttpSignatureAuth) loadPrivateKey() (err error) {
err = file.Close()
}()
var priv []byte
priv, err = ioutil.ReadAll(file)
priv, err = io.ReadAll(file)
if err != nil {
return err
}
Expand Down
14 changes: 7 additions & 7 deletions internal/httpclient/api_metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions internal/httpclient/api_permission.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions internal/httpclient/api_relationship.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.