Skip to content

Commit

Permalink
Forbid print statements
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
SuperQ committed Sep 22, 2024
1 parent 1808690 commit cba37e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
linters:
enable:
- errcheck
- forbidigo
- godot
- gofmt
- goimports
Expand All @@ -15,6 +16,9 @@ linters:
- unused

linter-settings:
forbidigo:
forbid:
- 'fmt\.Print.*(# Do not commit print statements\.)?'
godot:
capital: true
exclude:
Expand Down
1 change: 0 additions & 1 deletion proc_smaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ func (p Proc) procSMapsRollupManual() (ProcSMapsRollup, error) {
func (s *ProcSMapsRollup) parseLine(line string) error {
kv := strings.SplitN(line, ":", 2)
if len(kv) != 2 {
fmt.Println(line)
return errors.New("invalid net/dev line, missing colon")
}

Expand Down

0 comments on commit cba37e5

Please sign in to comment.