diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-05-21 20:05:41 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-05-21 20:05:41 +0200 |
| commit | a83a4dece2b56b22d2d341b219656c5b63ebad86 (patch) | |
| tree | a463f3eb98ab63555905b40c75adc40eabf44f01 | |
| parent | 5ee0fb4aa53e02a4b6c2ffb3d5bfa3a6153c9a06 (diff) | |
| download | WRMS-a83a4dece2b56b22d2d341b219656c5b63ebad86.tar.gz WRMS-a83a4dece2b56b22d2d341b219656c5b63ebad86.zip | |
use io.ReadAll instead of the deprecated ioutil.ReadAll
| -rw-r--r-- | upload.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |
