enable revive linter

This commit is contained in:
Matthieu MOREL 2021-12-22 23:49:50 +01:00 committed by GitHub
parent 982ee3bc2b
commit 4671e649aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 10 deletions

View File

@ -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:

View File

@ -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 {

View File

@ -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 {

View File

@ -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