Skip to content

Commit

Permalink
ioutil -> os (facebookincubator#45)
Browse files Browse the repository at this point in the history
Summary:
ioutil package is deprecated

Pull Request resolved: facebookincubator#45

Reviewed By: mimir-d

Differential Revision: D45731080

Pulled By: pmazzini

fbshipit-source-id: 6f638d12f704667fb8a63fb64decf3d6bc5d7fad
  • Loading branch information
pmazzini authored and facebook-github-bot committed May 10, 2023
1 parent e708a18 commit 693a8df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=
Expand Down
6 changes: 3 additions & 3 deletions lib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ package dhcplb
import (
"encoding/json"
"fmt"
"io/ioutil"
"net"
"os"
"path/filepath"
"strings"
"time"
Expand Down Expand Up @@ -69,15 +69,15 @@ type Overrides struct {
// file, an integer version and a ConfigProvider and will return a pointer to
// a Config object.
func LoadConfig(path, overridesPath string, version int, provider ConfigProvider) (*Config, error) {
file, err := ioutil.ReadFile(path)
file, err := os.ReadFile(path)
if err != nil {
return nil, err
}

overridesFile := []byte{}
// path length of 0 means we aren't using overrides
if len(overridesPath) != 0 {
if overridesFile, err = ioutil.ReadFile(overridesPath); err != nil {
if overridesFile, err = os.ReadFile(overridesPath); err != nil {
return nil, err
}
}
Expand Down

0 comments on commit 693a8df

Please sign in to comment.