mirror of
https://github.com/makeworld-the-better-one/amfora.git
synced 2024-11-25 13:52:16 +03:00
🚨 Lint fixes
This commit is contained in:
parent
90089cba0a
commit
2043ed7212
@ -25,7 +25,6 @@ linters:
|
||||
- lll
|
||||
- maligned
|
||||
- misspell
|
||||
- nakedret
|
||||
- nolintlint
|
||||
- prealloc
|
||||
- scopelint
|
||||
|
@ -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)
|
||||
|
1
rr/rr.go
1
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 {
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user