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"
"log"
"os"
"sort"
@@ -375,7 +374,7 @@ func (r *Replica) calcPos(ctx context.Context, generation string) (pos Pos, err
}
defer rd.Close()
n, err := io.Copy(ioutil.Discard, lz4.NewReader(rd))
n, err := io.Copy(io.Discard, lz4.NewReader(rd))
if err != nil {
return pos, err
}