update golangci-lint action to v3, golangci-lint to v1.48.0 (#3499)

* run gofmt -s -w

* stop using the deprecated io/ioutil package

* update golangci-lint action to v3, golangci-lint to v1.48.0
This commit is contained in:
Marten Seemann
2022-08-10 18:50:48 +02:00
committed by GitHub
parent 7ebe1430ef
commit 498475fa60
20 changed files with 39 additions and 37 deletions

View File

@@ -4,7 +4,7 @@ import (
"context"
"crypto/tls"
"errors"
"io/ioutil"
"io"
"log"
"net"
"net/http"
@@ -118,7 +118,7 @@ func (c *client) doRequest(req *http.Request) (*http.Response, error) {
ProtoMajor: 0,
ProtoMinor: 9,
Request: req,
Body: ioutil.NopCloser(str),
Body: io.NopCloser(str),
}
return rsp, nil
}

View File

@@ -3,7 +3,7 @@ package http09
import (
"crypto/tls"
"fmt"
"io/ioutil"
"io"
"net"
"net/http"
"net/http/httptest"
@@ -62,7 +62,7 @@ var _ = Describe("HTTP 0.9 integration tests", func() {
)
rsp, err := rt.RoundTrip(req)
Expect(err).ToNot(HaveOccurred())
data, err := ioutil.ReadAll(rsp.Body)
data, err := io.ReadAll(rsp.Body)
Expect(err).ToNot(HaveOccurred())
Expect(data).To(Equal([]byte("Hello World!")))
})
@@ -83,7 +83,7 @@ var _ = Describe("HTTP 0.9 integration tests", func() {
)
rsp, err := rt.RoundTrip(req)
Expect(err).ToNot(HaveOccurred())
data, err := ioutil.ReadAll(rsp.Body)
data, err := io.ReadAll(rsp.Body)
Expect(err).ToNot(HaveOccurred())
Expect(data).To(Equal([]byte("done")))
})

View File

@@ -4,7 +4,6 @@ import (
"context"
"errors"
"io"
"io/ioutil"
"log"
"net"
"net/http"
@@ -102,7 +101,7 @@ func (s *Server) handleConn(conn quic.Connection) {
}
func (s *Server) handleStream(str quic.Stream) error {
reqBytes, err := ioutil.ReadAll(str)
reqBytes, err := io.ReadAll(str)
if err != nil {
return err
}