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,6 @@ import (
"context"
"errors"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -157,7 +156,7 @@ func backupAction(ctx *cli.Context) error {
fmt.Println(out.String())
} else {
// Write output to file.
if err := ioutil.WriteFile(indexFileName, []byte(out.String()), os.ModePerm); err != nil {
if err := os.WriteFile(indexFileName, []byte(out.String()), os.ModePerm); err != nil {
return err
}
}