Skip to content

Commit

Permalink
cgroups: golangci-lint fixes.
Browse files Browse the repository at this point in the history
Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub authored and askervin committed Dec 11, 2024
1 parent ac591f1 commit 934279f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions pkg/cgroups/cgroupblkio.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package cgroups
import (
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strconv"
Expand Down Expand Up @@ -341,7 +340,7 @@ var currentPlatform platformInterface = defaultPlatform{}

// readFromFile returns file contents as a string.
func (dpm defaultPlatform) readFromFile(filename string) (string, error) {
content, err := ioutil.ReadFile(filename)
content, err := os.ReadFile(filename)
return string(content), err
}

Expand All @@ -352,6 +351,6 @@ func (dpm defaultPlatform) writeToFile(filename string, content string) error {
return err
}
defer f.Close()
_, err = fmt.Fprintf(f, content)
_, err = fmt.Fprintf(f, "%s", content)
return err
}
4 changes: 2 additions & 2 deletions pkg/cgroups/cgroupstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package cgroups

import (
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"strconv"
Expand Down Expand Up @@ -89,7 +89,7 @@ type GlobalNumaStats struct {

func readCgroupFileLines(filePath string) ([]string, error) {

f, err := ioutil.ReadFile(filePath)
f, err := os.ReadFile(filePath)

if err != nil {
return nil, err
Expand Down

0 comments on commit 934279f

Please sign in to comment.