enable revive linter

pull/1208/head
Matthieu MOREL 3 years ago committed by GitHub
parent 982ee3bc2b
commit 4671e649aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,12 @@
issues: issues:
max-same-issues: 0 max-same-issues: 0
exclude-rules:
- linters:
- revive
text: "var-naming"
- linters:
- revive
text: "exported"
linters: linters:
enable: enable:
- durationcheck - durationcheck
@ -9,6 +16,7 @@ linters:
- gofumpt - gofumpt
- gosimple - gosimple
- misspell - misspell
- revive
- typecheck - typecheck
- unparam - unparam
disable: disable:

@ -486,9 +486,8 @@ func LabelWithContext(ctx context.Context, name string) (string, error) {
dmname, err := ioutil.ReadFile(dmname_filename) dmname, err := ioutil.ReadFile(dmname_filename)
if err != nil { if err != nil {
return "", err return "", err
} else {
return strings.TrimSpace(string(dmname)), nil
} }
return strings.TrimSpace(string(dmname)), nil
} }
func getFsType(stat unix.Statfs_t) string { func getFsType(stat unix.Statfs_t) string {

@ -15,9 +15,8 @@ func (w *Warnings) Add(err error) {
func (w *Warnings) Reference() error { func (w *Warnings) Reference() error {
if len(w.List) > 0 { if len(w.List) > 0 {
return w return w
} else {
return nil
} }
return nil
} }
func (w *Warnings) Error() string { func (w *Warnings) Error() string {

@ -503,13 +503,12 @@ func (p *Process) EnvironWithContext(ctx context.Context) ([]string, error) {
func limitToUint(val string) (uint64, error) { func limitToUint(val string) (uint64, error) {
if val == "unlimited" { if val == "unlimited" {
return math.MaxUint64, nil 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 // Get num_fds from /proc/(pid)/limits

Loading…
Cancel
Save