From 3949271d0d92e755f55cdce6694dd7f47c946c64 Mon Sep 17 00:00:00 2001 From: Marco Munizaga Date: Tue, 30 Apr 2024 17:28:11 -0700 Subject: [PATCH] Ignore/fix lints --- conn.go | 2 +- conn_test.go | 9 ++++----- examples/util/util.go | 3 +-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/conn.go b/conn.go index 30952bdeb..bb4d83da7 100644 --- a/conn.go +++ b/conn.go @@ -994,7 +994,7 @@ func (c *Conn) isHandshakeCompletedSuccessfully() bool { return boolean.bool } -func (c *Conn) handshake(ctx context.Context, cfg *handshakeConfig, initialFlight flightVal, initialState handshakeState) error { //nolint:gocognit +func (c *Conn) handshake(ctx context.Context, cfg *handshakeConfig, initialFlight flightVal, initialState handshakeState) error { //nolint:gocognit,contextcheck c.fsm = newHandshakeFSM(&c.state, c.handshakeCache, cfg, initialFlight) done := make(chan struct{}) diff --git a/conn_test.go b/conn_test.go index 840809d7b..a316f4b83 100644 --- a/conn_test.go +++ b/conn_test.go @@ -3187,8 +3187,8 @@ func TestApplicationDataQueueLimited(t *testing.T) { defer cancel() ca, cb := dpipe.Pipe() - defer ca.Close() - defer cb.Close() + defer ca.Close() //nolint:errcheck + defer cb.Close() //nolint:errcheck done := make(chan struct{}) go func() { @@ -3216,7 +3216,6 @@ func TestApplicationDataQueueLimited(t *testing.T) { t.Log(qlen) time.Sleep(1 * time.Second) } - }() if _, err := handshakeConn(ctx, dconn, cfg, false, nil); err == nil { t.Error("expected handshake to fail") @@ -3249,12 +3248,12 @@ func TestApplicationDataQueueLimited(t *testing.T) { if err != nil { t.Fatal(err) } - ca.Write(packet) + ca.Write(packet) // nolint if i%100 == 0 { time.Sleep(10 * time.Millisecond) } } time.Sleep(1 * time.Second) - ca.Close() + ca.Close() // nolint <-done } diff --git a/examples/util/util.go b/examples/util/util.go index f6a9642c0..e15a2f360 100644 --- a/examples/util/util.go +++ b/examples/util/util.go @@ -11,7 +11,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "net" "os" "path/filepath" @@ -70,7 +69,7 @@ func LoadKeyAndCertificate(keyPath string, certificatePath string) (tls.Certific // LoadCertificate Load/read certificate(s) from file func LoadCertificate(path string) (*tls.Certificate, error) { - rawData, err := ioutil.ReadFile(filepath.Clean(path)) + rawData, err := os.ReadFile(filepath.Clean(path)) if err != nil { return nil, err }