chore: remove refs to deprecated io/ioutil (#72)

This commit is contained in:
guangwu
2023-08-31 19:55:38 +08:00
committed by GitHub
parent a41bc10f8a
commit 5e3db83656
2 changed files with 3 additions and 5 deletions

View File

@@ -1,7 +1,6 @@
package main
import (
"io/ioutil"
"net/url"
"os"
"strings"
@@ -43,7 +42,7 @@ func readConfig(configFile string) *configData {
if _, err := os.Stat(configFile); os.IsNotExist(err) {
panic(err)
}
data, err := ioutil.ReadFile(configFile)
data, err := os.ReadFile(configFile)
if err != nil {
panic(err)
}
@@ -67,7 +66,7 @@ func readConfig(configFile string) *configData {
if _, err := os.Stat(config.PasswordFile); os.IsNotExist(err) {
panic(err)
}
data, err := ioutil.ReadFile(config.PasswordFile)
data, err := os.ReadFile(config.PasswordFile)
if err != nil {
panic(err)
}

View File

@@ -2,7 +2,6 @@ package registry
import (
"fmt"
"io/ioutil"
"math"
"os"
"regexp"
@@ -59,7 +58,7 @@ func PurgeOldTags(client *Client, config *PurgeTagsConfig) {
logger.Error("Not purging anything!")
return
}
data, err := ioutil.ReadFile(config.KeepFromFile)
data, err := os.ReadFile(config.KeepFromFile)
if err != nil {
logger.Warnf("Cannot read %s: %s", config.KeepFromFile, err)
logger.Error("Not purging anything!")