Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nsqio/go-nsq into channel…
Browse files Browse the repository at this point in the history
…_stats_command
  • Loading branch information
侯尧 committed Sep 5, 2024
2 parents 366f5e4 + 8098697 commit dd2b749
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions api_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nsq
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net"
"net/http"
"time"
Expand Down Expand Up @@ -47,7 +47,7 @@ func apiRequestNegotiateV1(httpclient *http.Client, method string, endpoint stri
return err
}

respBody, err := ioutil.ReadAll(resp.Body)
respBody, err := io.ReadAll(resp.Body)
resp.Body.Close()
if err != nil {
return err
Expand Down
3 changes: 1 addition & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"crypto/x509"
"errors"
"fmt"
"io/ioutil"
"log"
"math"
"math/rand"
Expand Down Expand Up @@ -434,7 +433,7 @@ func (t *tlsConfig) Set(c *Config, option string, value interface{}) error {
return fmt.Errorf("ERROR: %v is not a string", value)
}
tlsCertPool := x509.NewCertPool()
caCertFile, err := ioutil.ReadFile(filename)
caCertFile, err := os.ReadFile(filename)
if err != nil {
return fmt.Errorf("ERROR: failed to read custom Certificate Authority file %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ func (c *Conn) upgradeSnappy() error {
conn = c.tlsConn
}
c.r = snappy.NewReader(conn)
c.w = snappy.NewWriter(conn)
c.w = snappy.NewBufferedWriter(conn)
frameType, data, err := ReadUnpackedResponse(c, c.config.MaxMsgSize)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func framedResponse(frameType int32, data []byte) []byte {
return nil
}

_, err = w.Write(data)
_, _ = w.Write(data)
return w.Bytes()
}

Expand Down
4 changes: 2 additions & 2 deletions producer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nsq
import (
"bytes"
"errors"
"io/ioutil"
"io"
"log"
"net"
"os"
Expand Down Expand Up @@ -63,7 +63,7 @@ func TestProducerConnection(t *testing.T) {
}

func TestProducerPing(t *testing.T) {
log.SetOutput(ioutil.Discard)
log.SetOutput(io.Discard)
defer log.SetOutput(os.Stdout)

config := NewConfig()
Expand Down

0 comments on commit dd2b749

Please sign in to comment.