Skip to content

Commit

Permalink
style: make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Feb 14, 2025
1 parent be7b15c commit 4606bc0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
6 changes: 1 addition & 5 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,5 @@ linters-settings:
excludes:
- G115

output:
# Make issues output unique by line.
# Default: true
# Note: unique in this case means that you can have at most 1 issue per line of code.
# one issue with a given line and we want to see them all at once.
issues:
uniq-by-line: false
4 changes: 2 additions & 2 deletions internal/utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package utils
import (
"debug/gosym"
"debug/pe"
"fmt"
"errors"
"maps"
"reflect"
"strings"
Expand Down Expand Up @@ -157,7 +157,7 @@ func TestMust(t *testing.T) {
})

t.Run("panics for non-nil error", func(t *testing.T) {
assert.Panics(t, func() { Must(fmt.Errorf("test error")) })
assert.Panics(t, func() { Must(errors.New("test error")) })
})
}

Expand Down
2 changes: 1 addition & 1 deletion internal/wrapper/elf.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (e *ElfWrapper) ReadAddr(addr, size uint64) ([]byte, error) {
func (e *ElfWrapper) Text() (textStart uint64, text []byte, err error) {
sect := e.file.Section(".text")
if sect == nil {
return 0, nil, fmt.Errorf("text section not found")
return 0, nil, errors.New("text section not found")
}
textStart = sect.Addr
text, err = sect.Data()
Expand Down
3 changes: 2 additions & 1 deletion internal/wrapper/macho.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"compress/zlib"
"debug/dwarf"
"encoding/binary"
"errors"
"fmt"
"io"
"slices"
Expand Down Expand Up @@ -295,7 +296,7 @@ func (m *MachoWrapper) Text() (textStart uint64, text []byte, err error) {
}
}
if sect == nil {
return 0, nil, fmt.Errorf("text section not found")
return 0, nil, errors.New("text section not found")
}
textStart = sect.Addr
text, err = sect.Data()
Expand Down

0 comments on commit 4606bc0

Please sign in to comment.