Skip to content

Commit 881f5ee

Browse files
committed
refactor(oomcli|oomagent): replace ioutil.ReadFile with os.ReadFile
1 parent e923e01 commit 881f5ee

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

oomagent/root.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package main
33
import (
44
"context"
55
"fmt"
6-
"io/ioutil"
76
"log"
87
"net"
98
"os"
@@ -102,7 +101,7 @@ func initConfig() {
102101
if envCfgFile := os.Getenv("OOMAGENT_CONFIG"); envCfgFile != "" {
103102
cfgFile = envCfgFile
104103
}
105-
cfgContent, err := ioutil.ReadFile(filepath.Clean(cfgFile))
104+
cfgContent, err := os.ReadFile(filepath.Clean(cfgFile))
106105
if err != nil {
107106
fmt.Fprintf(os.Stderr, "failed reading config file: %v\n", err)
108107
os.Exit(1)

oomcli/cmd/root.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package cmd
22

33
import (
44
"fmt"
5-
"io/ioutil"
65
"os"
76
"path/filepath"
87

@@ -52,7 +51,7 @@ func initConfig() {
5251
if envCfgFile := os.Getenv("OOMCLI_CONFIG"); envCfgFile != "" {
5352
cfgFile = envCfgFile
5453
}
55-
cfgContent, err := ioutil.ReadFile(filepath.Clean(cfgFile))
54+
cfgContent, err := os.ReadFile(filepath.Clean(cfgFile))
5655
if err != nil {
5756
exitf("failed reading config file: %v\n", err)
5857
}

0 commit comments

Comments
 (0)