Skip to content

Commit

Permalink
chore: linter config update (#347)
Browse files Browse the repository at this point in the history
Signed-off-by: James Hillyerd <james@hillyerd.com>
  • Loading branch information
jhillyerd authored Aug 31, 2024
1 parent 251544f commit 7b4e345
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.21
go-version: 1.22
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.60.3
3 changes: 1 addition & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ linters:
- bodyclose
- containedctx
- contextcheck
- copyloopvar
- decorder
# - dupl
- durationcheck
- errchkjson
- errname
# - errorlint
- execinquery
# - exhaustive
- exportloopref
# - forcetypeassert
- ginkgolinter
- gocheckcompilerdirectives
Expand Down
6 changes: 3 additions & 3 deletions boundary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,12 +517,12 @@ func TestReadLenNotCap(t *testing.T) {

var out []byte
b := make([]byte, 6, 20) // Ensure the capacity is greater than the length.
max := len(b)
maxb := len(b)
var c int
for err == nil {
c, err = br.Read(b)
if c > max {
t.Errorf("Per the docuemtation for io.Reader, should not have read more than %d bytes, but read %d", max, c)
if c > maxb {
t.Errorf("Per the docuemtation for io.Reader, should not have read more than %d bytes, but read %d", maxb, c)
}

out = append(out, b[0:c]...)
Expand Down
2 changes: 1 addition & 1 deletion encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package enmime_test

import (
"bytes"
"crypto/rand"
"io"
"math/rand"
"testing"
"time"

Expand Down
8 changes: 4 additions & 4 deletions internal/stringutil/wrap.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package stringutil

// Wrap builds a byte slice from strs, wrapping on word boundaries before max chars
func Wrap(max int, strs ...string) []byte {
// Wrap builds a byte slice from strs, wrapping on word boundaries before maxLen chars
func Wrap(maxLen int, strs ...string) []byte {
input := make([]byte, 0)
output := make([]byte, 0)
for _, s := range strs {
input = append(input, []byte(s)...)
}
if len(input) < max {
if len(input) < maxLen {
// Doesn't need to be wrapped
return input
}
Expand All @@ -20,7 +20,7 @@ func Wrap(max int, strs ...string) []byte {
case ' ', '\t':
ls = i
}
if ll >= max {
if ll >= maxLen {
if ls >= 0 {
output = append(output, input[lw+1:ls]...)
output = append(output, '\r', '\n', ' ')
Expand Down
4 changes: 2 additions & 2 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func MaxStoredPartErrors(n int) Option {
type maxStoredPartErrorsOption int

func (o maxStoredPartErrorsOption) apply(p *Parser) {
max := int(o)
p.maxStoredPartErrors = &max
n := int(o)
p.maxStoredPartErrors = &n
}

// RawContent if set to true will not try to decode the CTE and return the raw part content.
Expand Down

0 comments on commit 7b4e345

Please sign in to comment.