mirror of
https://github.com/golang/go
synced 2024-11-17 02:24:42 -07: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:
parent
e23322e2cc
commit
e7d238aaf4
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user