From 303bc6851c1952c20fe983f60b89d52f0fe48495 Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Sat, 13 Aug 2022 11:15:08 -0700 Subject: [PATCH] remove ioutil Signed-off-by: Ben Ye --- pkg/queryfrontend/queryinstant_codec.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/queryfrontend/queryinstant_codec.go b/pkg/queryfrontend/queryinstant_codec.go index e8743494c6..0f06d77a9b 100644 --- a/pkg/queryfrontend/queryinstant_codec.go +++ b/pkg/queryfrontend/queryinstant_codec.go @@ -7,7 +7,7 @@ import ( "bytes" "context" "encoding/json" - "io/ioutil" + "io" "net/http" "net/url" "sort" @@ -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)), } @@ -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