Enable module graph pruning and deprecate io/ioutil (#1600)

* Backend: Enable Go module graph pruning and lazy module loading

This commit applies the changes by running `go mod tidy -go=1.17` to
enable module graph pruning and lazy module loading supported by Go 1.17
or higher.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* Backend: Move from io/ioutil to io and os package

The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun
2021-10-06 13:10:50 +08:00
committed by GitHub
parent 78fe4ff67b
commit 44f7700c0c
33 changed files with 98 additions and 87 deletions

View File

@@ -5,7 +5,7 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"regexp"
@@ -124,7 +124,7 @@ func restoreAction(ctx *cli.Context) error {
log.Infof("restoring index from %s", txt.Quote(indexFileName))
sqlBackup, err := ioutil.ReadFile(indexFileName)
sqlBackup, err := os.ReadFile(indexFileName)
if err != nil {
return err