From 2043ed7212cb3f937a2396d024f1fb2af4748ba7 Mon Sep 17 00:00:00 2001 From: makeworld Date: Thu, 17 Dec 2020 11:37:48 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Lint=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .golangci.yml | 1 - display/handlers.go | 8 ++++---- rr/rr.go | 1 - rr/rr_test.go | 1 + 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 39ce25f..80cc6f1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -25,7 +25,6 @@ linters: - lll - maligned - misspell - - nakedret - nolintlint - prealloc - scopelint diff --git a/display/handlers.go b/display/handlers.go index 856c7e8..aee0149 100644 --- a/display/handlers.go +++ b/display/handlers.go @@ -377,7 +377,7 @@ func handleURL(t *tab, u string, numRedirects int) (string, bool) { if errors.Is(err, renderer.ErrTooLarge) { // Downloading now // Disable read timeout and go back to start - res.SetReadTimeout(0) + res.SetReadTimeout(0) //nolint: errcheck res.Body.(*rr.RestartReader).Restart() go dlChoice("That page is too large. What would you like to do?", u, res) return ret("", false) @@ -385,7 +385,7 @@ func handleURL(t *tab, u string, numRedirects int) (string, bool) { if errors.Is(err, renderer.ErrTimedOut) { // Downloading now // Disable read timeout and go back to start - res.SetReadTimeout(0) + res.SetReadTimeout(0) //nolint: errcheck res.Body.(*rr.RestartReader).Restart() go dlChoice("Loading that page timed out. What would you like to do?", u, res) return ret("", false) @@ -501,7 +501,7 @@ func handleURL(t *tab, u string, numRedirects int) (string, bool) { if !added { // Otherwise offer download choices // Disable read timeout and go back to start - res.SetReadTimeout(0) + res.SetReadTimeout(0) //nolint: errcheck res.Body.(*rr.RestartReader).Restart() go dlChoice("That file could not be displayed. What would you like to do?", u, res) } @@ -511,7 +511,7 @@ func handleURL(t *tab, u string, numRedirects int) (string, bool) { // Otherwise offer download choices // Disable read timeout and go back to start - res.SetReadTimeout(0) + res.SetReadTimeout(0) //nolint: errcheck res.Body.(*rr.RestartReader).Restart() go dlChoice("That file could not be displayed. What would you like to do?", u, res) return ret("", false) diff --git a/rr/rr.go b/rr/rr.go index a9b84c5..ffd8a8a 100644 --- a/rr/rr.go +++ b/rr/rr.go @@ -5,7 +5,6 @@ import ( "io" ) -// ErrTooLarge is passed to panic if memory cannot be allocated to store data in a buffer. var ErrClosed = errors.New("RestartReader: closed") type RestartReader struct { diff --git a/rr/rr_test.go b/rr/rr_test.go index 1ee52cc..fb16f3c 100644 --- a/rr/rr_test.go +++ b/rr/rr_test.go @@ -23,6 +23,7 @@ func TestRead(t *testing.T) { assert.Equal(t, []byte{'1'}, p, "should have read one byte, '1'") } +//nolint func TestRestart(t *testing.T) { reset() p := make([]byte, 4)