fix: remove deprecated ioutil and rand calls

- Change ioutil to io and os calls per Go 1.16 deprecation
- Move global random to localized random source
This commit is contained in:
Tyler Davis
2023-02-21 20:19:36 +00:00
committed by Ben Johnson
parent 6bbced3d46
commit 91e57a6156
6 changed files with 15 additions and 19 deletions

View File

@@ -4,7 +4,6 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"sort"
@@ -111,7 +110,7 @@ func (c *FileReplicaClient) Generations(ctx context.Context) ([]string, error) {
return nil, fmt.Errorf("cannot determine generations path: %w", err)
}
fis, err := ioutil.ReadDir(root)
fis, err := os.ReadDir(root)
if os.IsNotExist(err) {
return nil, nil
} else if err != nil {