Skip to content

Commit e3234a1

Browse files
committed
golangci-lint: ignore QF1010 (convert byte slices to strings before printing)
Printing a []byte and a string([]byte) are not the same thing. We typically print bytes on purpose, so we don't need this linter. Fixed one case where we should've been using t.Log instead of fmt.Println anyway. Signed-off-by: Timo Beckers <[email protected]>
1 parent 4d8e31a commit e3234a1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.golangci.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ linters:
99
- staticcheck
1010
- unused
1111
settings:
12+
staticcheck:
13+
checks:
14+
[
15+
# Defaults
16+
"all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022",
17+
# Convert slice of bytes to string when printing it.
18+
"-QF1010",
19+
]
1220
depguard:
1321
rules:
1422
no-x-sys-unix:

btf/types_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ func TestInflateLegacyBitfield(t *testing.T) {
435435
t.Run(test.name, func(t *testing.T) {
436436
types, err := readAndInflateTypes(test.reader, binary.LittleEndian, 2, emptyStrings, nil)
437437
if err != nil {
438-
fmt.Println(before.Bytes())
438+
t.Log(before.Bytes())
439439
t.Fatal(err)
440440
}
441441

0 commit comments

Comments
 (0)