Fix deprecated uses of ioutil

This commit is contained in:
comp500
2023-01-20 18:43:46 +00:00
parent 79d3ed3957
commit 672d22d0dd
6 changed files with 9 additions and 15 deletions

View File

@@ -4,7 +4,6 @@ import (
"bufio"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"sort"
@@ -134,7 +133,7 @@ var initCmd = &cobra.Command{
_, err = os.Stat(indexFilePath)
if os.IsNotExist(err) {
// Create file
err = ioutil.WriteFile(indexFilePath, []byte{}, 0644)
err = os.WriteFile(indexFilePath, []byte{}, 0644)
if err != nil {
fmt.Printf("Error creating index file: %s\n", err)
os.Exit(1)