From 0865f566820a96b9c7e9720b85f236cf9c83dacd Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Wed, 27 Mar 2024 23:22:04 +0200 Subject: [PATCH] test: remove redundant error check --- .golangci.yml | 5 +++++ server_test.go | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index dded8fc422..fa85f7a675 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -80,6 +80,11 @@ linters-settings: - sloppyReassign - unnamedResult - whyNoLint + govet: + enable-all: true + disable: + - fieldalignment + - shadow issues: # Show all issues from a linter. diff --git a/server_test.go b/server_test.go index 2153c8987f..c17c89f179 100644 --- a/server_test.go +++ b/server_test.go @@ -4146,7 +4146,7 @@ func TestMaxReadTimeoutPerRequest(t *testing.T) { select { case err := <-ch: - if err == nil || err != nil && !strings.EqualFold(err.Error(), "timeout") { + if err == nil || !strings.EqualFold(err.Error(), "timeout") { t.Fatalf("Unexpected error from serveConn: %v", err) } case <-time.After(time.Second): @@ -4206,7 +4206,7 @@ func TestMaxWriteTimeoutPerRequest(t *testing.T) { select { case err := <-ch: - if err == nil || err != nil && !strings.EqualFold(err.Error(), "timeout") { + if err == nil || !strings.EqualFold(err.Error(), "timeout") { t.Fatalf("Unexpected error from serveConn: %v", err) } case <-time.After(time.Second):