]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal/vcweb: replace ioutil with os and io
authorOleksandr Redko <oleksandr.red+github@gmail.com>
Mon, 17 Apr 2023 09:39:37 +0000 (12:39 +0300)
committerGopher Robot <gobot@golang.org>
Fri, 21 Apr 2023 17:47:26 +0000 (17:47 +0000)
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>

src/cmd/go/internal/vcweb/auth.go
src/cmd/go/internal/vcweb/fossil.go

index 094a828e8158ef6eacefc38343c111ae1f225cda..383bf759ffcdc1ad44d22b15d695bdff519916d0 100644 (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
index 4b5db22b0aad33de3321219e4975befac8c708b5..cc24f2f1b0dc2f54a72737f58eb2cc5e45cf31b2 100644 (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
        }