Skip to content

Commit

Permalink
Remove ioutil (#780)
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Kochie <[email protected]>
  • Loading branch information
inosato authored Jul 30, 2022
1 parent bc36af0 commit 8652b95
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package config

import (
"fmt"
"io/ioutil"
"os"
"regexp"
"time"

Expand All @@ -24,7 +24,7 @@ import (
)

func LoadFile(filename string) (*Config, error) {
content, err := ioutil.ReadFile(filename)
content, err := os.ReadFile(filename)
if err != nil {
return nil, err
}
Expand Down
3 changes: 1 addition & 2 deletions generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package main

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand All @@ -37,7 +36,7 @@ func generateConfig(nodes *Node, nameToNode map[string]*Node, logger log.Logger)
return fmt.Errorf("unable to determine absolute path for output")
}

content, err := ioutil.ReadFile("generator.yml")
content, err := os.ReadFile("generator.yml")
if err != nil {
return fmt.Errorf("error reading yml config: %s", err)
}
Expand Down
4 changes: 2 additions & 2 deletions generator/net_snmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ import "C"

import (
"fmt"
"io/ioutil"
"io"
"os"
"sort"

Expand Down Expand Up @@ -177,7 +177,7 @@ func initSNMP(logger log.Logger) (string, error) {
ch := make(chan string)
errch := make(chan error)
go func() {
data, err := ioutil.ReadAll(r)
data, err := io.ReadAll(r)
if err != nil {
errch <- fmt.Errorf("error reading from pipe: %s", err)
return
Expand Down

0 comments on commit 8652b95

Please sign in to comment.