mirror of
https://github.com/gomods/athens
synced 2026-02-03 11:00:32 +00:00
feat: replace ioutil with io and os (#1816)
This commit is contained in:
Vendored
+2
-3
@@ -3,7 +3,6 @@ package external
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -88,7 +87,7 @@ func NewServer(strg storage.Backend) http.Handler {
|
||||
return
|
||||
}
|
||||
defer infoFile.Close()
|
||||
info, err := ioutil.ReadAll(infoFile)
|
||||
info, err := io.ReadAll(infoFile)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), 400)
|
||||
return
|
||||
@@ -99,7 +98,7 @@ func NewServer(strg storage.Backend) http.Handler {
|
||||
return
|
||||
}
|
||||
defer modReader.Close()
|
||||
modFile, err := ioutil.ReadAll(modReader)
|
||||
modFile, err := io.ReadAll(modReader)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), 400)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user