diff --git a/.golangci.yml b/.golangci.yml index 82d9a31..d4628c2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,12 @@ issues: max-same-issues: 0 + exclude-rules: + - linters: + - revive + text: "var-naming" + - linters: + - revive + text: "exported" linters: enable: - durationcheck @@ -9,6 +16,7 @@ linters: - gofumpt - gosimple - misspell + - revive - typecheck - unparam disable: diff --git a/disk/disk_linux.go b/disk/disk_linux.go index 24337d0..5a0cf46 100644 --- a/disk/disk_linux.go +++ b/disk/disk_linux.go @@ -486,9 +486,8 @@ func LabelWithContext(ctx context.Context, name string) (string, error) { dmname, err := ioutil.ReadFile(dmname_filename) if err != nil { return "", err - } else { - return strings.TrimSpace(string(dmname)), nil } + return strings.TrimSpace(string(dmname)), nil } func getFsType(stat unix.Statfs_t) string { diff --git a/host/types.go b/host/types.go index 1eff475..c2e7c0b 100644 --- a/host/types.go +++ b/host/types.go @@ -15,9 +15,8 @@ func (w *Warnings) Add(err error) { func (w *Warnings) Reference() error { if len(w.List) > 0 { return w - } else { - return nil } + return nil } func (w *Warnings) Error() string { diff --git a/process/process_linux.go b/process/process_linux.go index 442b40a..af8f232 100644 --- a/process/process_linux.go +++ b/process/process_linux.go @@ -503,13 +503,12 @@ func (p *Process) EnvironWithContext(ctx context.Context) ([]string, error) { func limitToUint(val string) (uint64, error) { if val == "unlimited" { return math.MaxUint64, nil - } else { - res, err := strconv.ParseUint(val, 10, 64) - if err != nil { - return 0, err - } - return res, nil } + res, err := strconv.ParseUint(val, 10, 64) + if err != nil { + return 0, err + } + return res, nil } // Get num_fds from /proc/(pid)/limits