Skip to content

Commit

Permalink
Enable and appease the staticcheck linter
Browse files Browse the repository at this point in the history
  • Loading branch information
silkeh committed Sep 1, 2023
1 parent 2d7aa17 commit 72bf9cf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ linters:
- gochecknoglobals
- gochecknoinits
- revive
- staticcheck
- stylecheck
- wrapcheck
# Disabled permanently
Expand Down
3 changes: 1 addition & 2 deletions config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package config

import (
"fmt"
"io/ioutil"
"os"
"os/user"
"path/filepath"
Expand All @@ -31,7 +30,7 @@ import (
func Load(path string) (tm triggers.Map, err error) {
tm = make(triggers.Map)

entries, err := ioutil.ReadDir(path)
entries, err := os.ReadDir(path)
if err != nil {
log.Debugf("Skipped directory '%s':\n", path)

Expand Down
3 changes: 1 addition & 2 deletions triggers/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package triggers
import (
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"

Expand All @@ -31,7 +30,7 @@ func (t *Trigger) Load(path string) error {
return err
}
// Read the configuration into the program
cfg, err := ioutil.ReadFile(filepath.Clean(path))
cfg, err := os.ReadFile(filepath.Clean(path))
if err != nil {
return fmt.Errorf("unable to read config file located at %q: %w", path, err)
}
Expand Down
4 changes: 2 additions & 2 deletions util/chroot.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package util

import (
"io/ioutil"
"io"
"os"
"path/filepath"
"strconv"
Expand Down Expand Up @@ -46,7 +46,7 @@ func IsChroot() bool {
goto FALLBACK
}

raw, err = ioutil.ReadAll(mounts)
raw, err = io.ReadAll(mounts)
if err != nil {
log.Warnf("Failed to read '/proc/mounts', reason: %s\n", err)
goto FALLBACK
Expand Down

0 comments on commit 72bf9cf

Please sign in to comment.