Skip to content

Commit

Permalink
remove ioutil
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <ben.ye@bytedance.com>
  • Loading branch information
Ben Ye committed Aug 13, 2022
1 parent 19e1dae commit 303bc68
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/queryfrontend/queryinstant_codec.go
Expand Up @@ -7,7 +7,7 @@ import (
"bytes"
"context"
"encoding/json"
"io/ioutil"
"io"
"net/http"
"net/url"
"sort"
Expand Down Expand Up @@ -191,7 +191,7 @@ func (c queryInstantCodec) EncodeResponse(ctx context.Context, res queryrange.Re
Header: http.Header{
"Content-Type": []string{"application/json"},
},
Body: ioutil.NopCloser(bytes.NewBuffer(b)),
Body: io.NopCloser(bytes.NewBuffer(b)),
StatusCode: http.StatusOK,
ContentLength: int64(len(b)),
}
Expand All @@ -200,7 +200,7 @@ func (c queryInstantCodec) EncodeResponse(ctx context.Context, res queryrange.Re

func (c queryInstantCodec) DecodeResponse(ctx context.Context, r *http.Response, _ queryrange.Request) (queryrange.Response, error) {
if r.StatusCode/100 != 2 {
body, _ := ioutil.ReadAll(r.Body)
body, _ := io.ReadAll(r.Body)
return nil, httpgrpc.Errorf(r.StatusCode, string(body))
}
log, ctx := spanlogger.New(ctx, "ParseQueryInstantResponse") //nolint:ineffassign,staticcheck
Expand Down

0 comments on commit 303bc68

Please sign in to comment.