Skip to content

Commit

Permalink
refactor(oomcli|oomagent): replace ioutil.ReadFile with os.ReadFile
Browse files Browse the repository at this point in the history
  • Loading branch information
lianxmfor committed Feb 24, 2022
1 parent e923e01 commit 881f5ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions oomagent/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"context"
"fmt"
"io/ioutil"
"log"
"net"
"os"
Expand Down Expand Up @@ -102,7 +101,7 @@ func initConfig() {
if envCfgFile := os.Getenv("OOMAGENT_CONFIG"); envCfgFile != "" {
cfgFile = envCfgFile
}
cfgContent, err := ioutil.ReadFile(filepath.Clean(cfgFile))
cfgContent, err := os.ReadFile(filepath.Clean(cfgFile))
if err != nil {
fmt.Fprintf(os.Stderr, "failed reading config file: %v\n", err)
os.Exit(1)
Expand Down
3 changes: 1 addition & 2 deletions oomcli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cmd

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"

Expand Down Expand Up @@ -52,7 +51,7 @@ func initConfig() {
if envCfgFile := os.Getenv("OOMCLI_CONFIG"); envCfgFile != "" {
cfgFile = envCfgFile
}
cfgContent, err := ioutil.ReadFile(filepath.Clean(cfgFile))
cfgContent, err := os.ReadFile(filepath.Clean(cfgFile))
if err != nil {
exitf("failed reading config file: %v\n", err)
}
Expand Down

0 comments on commit 881f5ee

Please sign in to comment.