1
0
mirror of https://github.com/golang/go synced 2024-09-29 07:34:36 -06:00

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 <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Oleksandr Redko 2023-04-17 12:39:37 +03:00 committed by Gopher Robot
parent e23322e2cc
commit e7d238aaf4
2 changed files with 3 additions and 4 deletions

View File

@ -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

View File

@ -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
}