mirror of
https://github.com/makeworld-the-better-one/amfora.git
synced 2024-11-22 15:46:51 +03:00
🚨 Lint fixes
This commit is contained in:
parent
90089cba0a
commit
2043ed7212
@ -25,7 +25,6 @@ linters:
|
|||||||
- lll
|
- lll
|
||||||
- maligned
|
- maligned
|
||||||
- misspell
|
- misspell
|
||||||
- nakedret
|
|
||||||
- nolintlint
|
- nolintlint
|
||||||
- prealloc
|
- prealloc
|
||||||
- scopelint
|
- scopelint
|
||||||
|
@ -377,7 +377,7 @@ func handleURL(t *tab, u string, numRedirects int) (string, bool) {
|
|||||||
if errors.Is(err, renderer.ErrTooLarge) {
|
if errors.Is(err, renderer.ErrTooLarge) {
|
||||||
// Downloading now
|
// Downloading now
|
||||||
// Disable read timeout and go back to start
|
// Disable read timeout and go back to start
|
||||||
res.SetReadTimeout(0)
|
res.SetReadTimeout(0) //nolint: errcheck
|
||||||
res.Body.(*rr.RestartReader).Restart()
|
res.Body.(*rr.RestartReader).Restart()
|
||||||
go dlChoice("That page is too large. What would you like to do?", u, res)
|
go dlChoice("That page is too large. What would you like to do?", u, res)
|
||||||
return ret("", false)
|
return ret("", false)
|
||||||
@ -385,7 +385,7 @@ func handleURL(t *tab, u string, numRedirects int) (string, bool) {
|
|||||||
if errors.Is(err, renderer.ErrTimedOut) {
|
if errors.Is(err, renderer.ErrTimedOut) {
|
||||||
// Downloading now
|
// Downloading now
|
||||||
// Disable read timeout and go back to start
|
// Disable read timeout and go back to start
|
||||||
res.SetReadTimeout(0)
|
res.SetReadTimeout(0) //nolint: errcheck
|
||||||
res.Body.(*rr.RestartReader).Restart()
|
res.Body.(*rr.RestartReader).Restart()
|
||||||
go dlChoice("Loading that page timed out. What would you like to do?", u, res)
|
go dlChoice("Loading that page timed out. What would you like to do?", u, res)
|
||||||
return ret("", false)
|
return ret("", false)
|
||||||
@ -501,7 +501,7 @@ func handleURL(t *tab, u string, numRedirects int) (string, bool) {
|
|||||||
if !added {
|
if !added {
|
||||||
// Otherwise offer download choices
|
// Otherwise offer download choices
|
||||||
// Disable read timeout and go back to start
|
// Disable read timeout and go back to start
|
||||||
res.SetReadTimeout(0)
|
res.SetReadTimeout(0) //nolint: errcheck
|
||||||
res.Body.(*rr.RestartReader).Restart()
|
res.Body.(*rr.RestartReader).Restart()
|
||||||
go dlChoice("That file could not be displayed. What would you like to do?", u, res)
|
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
|
// Otherwise offer download choices
|
||||||
// Disable read timeout and go back to start
|
// Disable read timeout and go back to start
|
||||||
res.SetReadTimeout(0)
|
res.SetReadTimeout(0) //nolint: errcheck
|
||||||
res.Body.(*rr.RestartReader).Restart()
|
res.Body.(*rr.RestartReader).Restart()
|
||||||
go dlChoice("That file could not be displayed. What would you like to do?", u, res)
|
go dlChoice("That file could not be displayed. What would you like to do?", u, res)
|
||||||
return ret("", false)
|
return ret("", false)
|
||||||
|
1
rr/rr.go
1
rr/rr.go
@ -5,7 +5,6 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ErrTooLarge is passed to panic if memory cannot be allocated to store data in a buffer.
|
|
||||||
var ErrClosed = errors.New("RestartReader: closed")
|
var ErrClosed = errors.New("RestartReader: closed")
|
||||||
|
|
||||||
type RestartReader struct {
|
type RestartReader struct {
|
||||||
|
@ -23,6 +23,7 @@ func TestRead(t *testing.T) {
|
|||||||
assert.Equal(t, []byte{'1'}, p, "should have read one byte, '1'")
|
assert.Equal(t, []byte{'1'}, p, "should have read one byte, '1'")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint
|
||||||
func TestRestart(t *testing.T) {
|
func TestRestart(t *testing.T) {
|
||||||
reset()
|
reset()
|
||||||
p := make([]byte, 4)
|
p := make([]byte, 4)
|
||||||
|
Loading…
Reference in New Issue
Block a user