From 5e3db83656a05452245149d2813e85588737fbd3 Mon Sep 17 00:00:00 2001 From: guangwu Date: Thu, 31 Aug 2023 19:55:38 +0800 Subject: [PATCH] chore: remove refs to deprecated io/ioutil (#72) --- config.go | 5 ++--- registry/tasks.go | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/config.go b/config.go index 153cf4f..8baaf59 100644 --- a/config.go +++ b/config.go @@ -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) } diff --git a/registry/tasks.go b/registry/tasks.go index 574cec3..6d81485 100644 --- a/registry/tasks.go +++ b/registry/tasks.go @@ -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!")