enable revive linter
This commit is contained in:
parent
982ee3bc2b
commit
4671e649aa
|
@ -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:
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue