From a83a4dece2b56b22d2d341b219656c5b63ebad86 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 21 May 2023 20:05:41 +0200 Subject: use io.ReadAll instead of the deprecated ioutil.ReadAll --- upload.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upload.go b/upload.go index ce11462..8333b25 100644 --- a/upload.go +++ b/upload.go @@ -7,7 +7,7 @@ import ( "os" "path" // "path/filepath" - "io/ioutil" + "io" "github.com/dhowden/tag" "muhq.space/go/wrms/llog" @@ -34,7 +34,7 @@ func NewUploadBackend(uploadDir string) *UploadBackend { } func (b *UploadBackend) upload(w http.ResponseWriter, r *http.Request) { - data, err := ioutil.ReadAll(r.Body) + data, err := io.ReadAll(r.Body) if err != nil { llog.Warning("Failed to read request body: %s", string(data)) http.Error(w, "Failed to read request body", http.StatusInternalServerError) -- cgit v1.2.3