Skip to content

Commit b553f50

Browse files
jonas-jonasaeneasr
authored andcommitted
chore: remove ioutil from open api templates
1 parent ae4a72e commit b553f50

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

.schema/openapi/templates/go/api.mustache

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package {{packageName}}
55
import (
66
"bytes"
77
"context"
8-
"io/ioutil"
8+
"io"
99
"net/http"
1010
"net/url"
1111
{{#imports}} "{{import}}"
@@ -243,7 +243,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class
243243
}
244244
{{/required}}
245245
if localVarFile != nil {
246-
fbs, _ := ioutil.ReadAll(localVarFile)
246+
fbs, _ := io.ReadAll(localVarFile)
247247
localVarFileBytes = fbs
248248
localVarFileName = localVarFile.Name()
249249
localVarFile.Close()
@@ -321,9 +321,9 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class
321321
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err
322322
}
323323

324-
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
324+
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
325325
localVarHTTPResponse.Body.Close()
326-
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
326+
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
327327
if err != nil {
328328
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err
329329
}

.schema/openapi/templates/go/signing.mustache

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"encoding/pem"
1515
"fmt"
1616
"io"
17-
"io/ioutil"
1817
"net/http"
1918
"net/textproto"
2019
"os"
@@ -178,7 +177,7 @@ func (h *HttpSignatureAuth) loadPrivateKey() (err error) {
178177
err = file.Close()
179178
}()
180179
var priv []byte
181-
priv, err = ioutil.ReadAll(file)
180+
priv, err = io.ReadAll(file)
182181
if err != nil {
183182
return err
184183
}

quickstart.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ services:
1616
restart: on-failure
1717
networks:
1818
- intranet
19-
kratos-selfservice-ui-node:
20-
image: oryd/kratos-selfservice-ui-node:v0.10.1
21-
environment:
22-
- KRATOS_PUBLIC_URL=http://kratos:4433/
23-
- KRATOS_BROWSER_URL=http://127.0.0.1:4433/
24-
networks:
25-
- intranet
26-
restart: on-failure
19+
# kratos-selfservice-ui-node:
20+
# image: oryd/kratos-selfservice-ui-node:v0.10.1
21+
# environment:
22+
# - KRATOS_PUBLIC_URL=http://kratos:4433/
23+
# - KRATOS_BROWSER_URL=http://127.0.0.1:4433/
24+
# networks:
25+
# - intranet
26+
# restart: on-failure
2727
kratos:
2828
depends_on:
2929
- kratos-migrate

0 commit comments

Comments
 (0)