@@ -3,7 +3,7 @@ package kroki
3
3
import (
4
4
"context"
5
5
"fmt"
6
- "io/ioutil "
6
+ "io"
7
7
"net/http"
8
8
"net/url"
9
9
"path"
@@ -46,7 +46,7 @@ func (c *Client) PostRequestContext(ctx context.Context, payload string, diagram
46
46
// read the result
47
47
defer response .Body .Close ()
48
48
if response .StatusCode != http .StatusOK {
49
- body , err := ioutil .ReadAll (response .Body )
49
+ body , err := io .ReadAll (response .Body )
50
50
var message string
51
51
if err != nil {
52
52
message = ""
@@ -57,7 +57,7 @@ func (c *Client) PostRequestContext(ctx context.Context, payload string, diagram
57
57
"fail to generate the image {status: %d, body: %s}" ,
58
58
response .StatusCode , message )
59
59
}
60
- body , err := ioutil .ReadAll (response .Body )
60
+ body , err := io .ReadAll (response .Body )
61
61
if err != nil {
62
62
return "" , errors .Wrap (err , "fail to read the response body" )
63
63
}
@@ -104,7 +104,7 @@ func (c *Client) GetRequestContext(ctx context.Context, payload string, diagramT
104
104
// read the result
105
105
defer response .Body .Close ()
106
106
if response .StatusCode != http .StatusOK {
107
- body , err := ioutil .ReadAll (response .Body )
107
+ body , err := io .ReadAll (response .Body )
108
108
var message string
109
109
if err != nil {
110
110
message = ""
@@ -115,7 +115,7 @@ func (c *Client) GetRequestContext(ctx context.Context, payload string, diagramT
115
115
"fail to generate the image {status: %d, body: %s}" ,
116
116
response .StatusCode , message )
117
117
}
118
- body , err := ioutil .ReadAll (response .Body )
118
+ body , err := io .ReadAll (response .Body )
119
119
if err != nil {
120
120
return "" , errors .Wrap (err , "fail to read the response body" )
121
121
}
0 commit comments