Skip to content

Commit c1f724a

Browse files
authored
Merge pull request #429 from testwill/ioutil
chore: remove refs to deprecated io/ioutil
2 parents 0048ab7 + 5122c29 commit c1f724a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/state/state.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ package state
2121
import (
2222
"encoding/json"
2323
"errors"
24-
"io/ioutil"
2524
"os"
2625

2726
timestamp "github.com/golang/protobuf/ptypes/timestamp"
@@ -145,7 +144,7 @@ func (s *state) dump() error {
145144
if err != nil {
146145
return status.Errorf(codes.Internal, "error encoding volumes and snapshots: %v", err)
147146
}
148-
if err := ioutil.WriteFile(s.statefilePath, data, 0600); err != nil {
147+
if err := os.WriteFile(s.statefilePath, data, 0600); err != nil {
149148
return status.Errorf(codes.Internal, "error writing state file: %v", err)
150149
}
151150
return nil
@@ -155,7 +154,7 @@ func (s *state) restore() error {
155154
s.Volumes = nil
156155
s.Snapshots = nil
157156

158-
data, err := ioutil.ReadFile(s.statefilePath)
157+
data, err := os.ReadFile(s.statefilePath)
159158
switch {
160159
case errors.Is(err, os.ErrNotExist):
161160
// Nothing to do.

0 commit comments

Comments
 (0)