From e7d238aaf44b420dc65c39f16733d57de8e9bbd1 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 17 Apr 2023 12:39:37 +0300 Subject: [PATCH] cmd/go/internal/vcweb: replace ioutil with os and io Change-Id: I251788cbbb6d740ef24e7561cc4bee880b7bdff8 Reviewed-on: https://go-review.googlesource.com/c/go/+/485017 Reviewed-by: Michael Pratt Run-TryBot: Michael Pratt Run-TryBot: Bryan Mills Reviewed-by: Bryan Mills Auto-Submit: Bryan Mills TryBot-Result: Gopher Robot --- src/cmd/go/internal/vcweb/auth.go | 4 ++-- src/cmd/go/internal/vcweb/fossil.go | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cmd/go/internal/vcweb/auth.go b/src/cmd/go/internal/vcweb/auth.go index 094a828e815..383bf759ffc 100644 --- a/src/cmd/go/internal/vcweb/auth.go +++ b/src/cmd/go/internal/vcweb/auth.go @@ -7,7 +7,7 @@ package vcweb import ( "encoding/json" "fmt" - "io/ioutil" + "io" "log" "net/http" "os" @@ -77,7 +77,7 @@ func (h *authHandler) Handler(dir string, env []string, logger *log.Logger) (htt accessDir = path.Dir(accessDir) } - data, err := ioutil.ReadAll(accessFile) + data, err := io.ReadAll(accessFile) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return diff --git a/src/cmd/go/internal/vcweb/fossil.go b/src/cmd/go/internal/vcweb/fossil.go index 4b5db22b0aa..cc24f2f1b0d 100644 --- a/src/cmd/go/internal/vcweb/fossil.go +++ b/src/cmd/go/internal/vcweb/fossil.go @@ -6,7 +6,6 @@ package vcweb import ( "fmt" - "io/ioutil" "log" "net/http" "net/http/cgi" @@ -39,7 +38,7 @@ func (h *fossilHandler) Handler(dir string, env []string, logger *log.Logger) (h cgiPath := db + ".cgi" cgiScript := fmt.Sprintf("#!%s\nrepository: %s\n", h.fossilPath, db) - if err := ioutil.WriteFile(cgiPath, []byte(cgiScript), 0755); err != nil { + if err := os.WriteFile(cgiPath, []byte(cgiScript), 0755); err != nil { return nil, err }