mirror of
https://github.com/walles/moar.git
synced 2024-09-11 12:15:43 +03:00
Handle some unused parameters issues
This commit is contained in:
parent
bc5260c95b
commit
7bd5d3e099
@ -1,3 +1,9 @@
|
||||
linters:
|
||||
enable:
|
||||
- gofmt
|
||||
|
||||
# I'd really want to use Revive for this but that doesn't work:
|
||||
# https://github.com/golangci/golangci-lint/issues/3653
|
||||
- unparam
|
||||
|
||||
- usestdlibvars
|
||||
|
@ -27,7 +27,7 @@ func highlight(filename string, force bool, style chroma.Style, formatter chroma
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if fileInfo.Size() > MAX_HIGHLIGHT_SIZE {
|
||||
if fileInfo.Size() > MAX_HIGHLIGHT_SIZE && !force {
|
||||
log.Debugf("Not highlighting %s because it is %d bytes large, which is larger than moar's built-in highlighting limit of %d bytes",
|
||||
filename, fileInfo.Size(), MAX_HIGHLIGHT_SIZE)
|
||||
return nil, nil
|
||||
|
@ -95,7 +95,7 @@ func TestBrokenUtf8(t *testing.T) {
|
||||
func startPaging(t *testing.T, reader *Reader) *twin.FakeScreen {
|
||||
err := reader._wait()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
t.Fatalf("Failed waiting for reader: %v", err)
|
||||
}
|
||||
|
||||
screen := twin.NewFakeScreen(20, 10)
|
||||
|
@ -448,7 +448,7 @@ func NewReaderFromFilename(filename string, style chroma.Style, formatter chroma
|
||||
}
|
||||
|
||||
// createStatusUnlocked() assumes that its caller is holding the lock
|
||||
func (r *Reader) createStatusUnlocked(firstLineOneBased int, lastLineOneBased int) string {
|
||||
func (r *Reader) createStatusUnlocked(lastLineOneBased int) string {
|
||||
prefix := ""
|
||||
if r.name != nil {
|
||||
prefix = path.Base(*r.name) + ": "
|
||||
@ -511,7 +511,7 @@ func (r *Reader) getLinesUnlocked(firstLineOneBased int, wantedLineCount int) *I
|
||||
// The line number set here won't matter, we'll clip it anyway when we get it back
|
||||
firstLineOneBased: 0,
|
||||
|
||||
statusText: r.createStatusUnlocked(0, 0),
|
||||
statusText: r.createStatusUnlocked(0),
|
||||
}
|
||||
}
|
||||
|
||||
@ -537,7 +537,7 @@ func (r *Reader) getLinesUnlocked(firstLineOneBased int, wantedLineCount int) *I
|
||||
return &InputLines{
|
||||
lines: r.lines[firstLineZeroBased : lastLineZeroBased+1],
|
||||
firstLineOneBased: firstLineOneBased,
|
||||
statusText: r.createStatusUnlocked(firstLineOneBased, lastLineZeroBased+1),
|
||||
statusText: r.createStatusUnlocked(lastLineZeroBased + 1),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user