Skip to content

Commit 5f4cfe1

Browse files
committed
Forbid print statements
Enable `forbidigo` to make sure print statements are not used in this library. This avoids injecting random log output into upstream user's log formatting. Signed-off-by: SuperQ <[email protected]>
1 parent 1808690 commit 5f4cfe1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.golangci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
linters:
33
enable:
44
- errcheck
5+
- forbidigo
56
- godot
67
- gofmt
78
- goimports
@@ -15,6 +16,9 @@ linters:
1516
- unused
1617

1718
linter-settings:
19+
forbidigo:
20+
forbid:
21+
- 'fmt\.Print.*(# Do not commit print statements\.)?'
1822
godot:
1923
capital: true
2024
exclude:

proc_smaps.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package procfs
1919
import (
2020
"bufio"
2121
"errors"
22-
"fmt"
2322
"os"
2423
"regexp"
2524
"strconv"
@@ -117,7 +116,6 @@ func (p Proc) procSMapsRollupManual() (ProcSMapsRollup, error) {
117116
func (s *ProcSMapsRollup) parseLine(line string) error {
118117
kv := strings.SplitN(line, ":", 2)
119118
if len(kv) != 2 {
120-
fmt.Println(line)
121119
return errors.New("invalid net/dev line, missing colon")
122120
}
123121

0 commit comments

Comments
 (0)