From 68c308179a1ef1c7e7dedcb201738667d9cf80ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=8B=E3=82=AB=E3=83=AB=E8=AB=8F?= =?UTF-8?q?=E8=A8=AA=E5=AD=90?= Date: Thu, 11 May 2023 12:50:19 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=9D=E3=81=A3=E3=81=8B=E3=80=81=E3=82=84?= =?UTF-8?q?=E3=81=A3=E3=81=B1ioutil=E3=82=92=E4=BD=BF=E3=82=8F=E3=81=AA?= =?UTF-8?q?=E3=81=8F=E3=81=9F=E6=96=B9=E3=81=8C=E8=89=AF=E3=81=84=E3=82=89?= =?UTF-8?q?=E3=81=97=E3=81=84=EF=BD=97=EF=BD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.go | 4 ++-- prep.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config.go b/config.go index 41acc86..090d40d 100644 --- a/config.go +++ b/config.go @@ -1,7 +1,7 @@ package main import ( - "io/ioutil" + "os" "fmt" "runtime" "encoding/json" @@ -31,7 +31,7 @@ func getconf () Config { cnf.configpath = prefix + cnf.configpath } - data, err := ioutil.ReadFile(cnf.configpath) + data, err := os.ReadFile(cnf.configpath) if err != nil { fmt.Println("エラー:", err) } diff --git a/prep.go b/prep.go index 2e040dd..ba1f002 100644 --- a/prep.go +++ b/prep.go @@ -7,7 +7,7 @@ import ( "strings" "path/filepath" "net/http" - "io/ioutil" + "io" ) func checkexist (url string, prefix string) []string { @@ -54,9 +54,9 @@ func getpage (url string, path string) { } defer curl.Body.Close() - body, err2 := ioutil.ReadAll(curl.Body) + body, err2 := io.ReadAll(curl.Body) if err2 != nil { - fmt.Println("ioutilエラ:", err2) + fmt.Println("読込エラ:", err2) return }