From 4c248acc185740c535bc7dc14ae9a363cac3382f Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 3 Jun 2024 21:12:31 +0100 Subject: Couple of minor fixes --- cmd/dbasik-api/handlers.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/dbasik-api/handlers.go b/cmd/dbasik-api/handlers.go index a36adf6..0f3bc92 100644 --- a/cmd/dbasik-api/handlers.go +++ b/cmd/dbasik-api/handlers.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "os" "path" @@ -28,12 +27,12 @@ func (app *application) createReturnHandler(w http.ResponseWriter, r *http.Reque returnFile, header, err := r.FormFile("returnfile") app.logger.Info("got excel file") if err != nil { - http.Error(w, "Missing file", http.StatusBadRequest) + http.Error(w, "Missing Excel file", http.StatusBadRequest) return } defer returnFile.Close() - tmpDir, err := ioutil.TempDir("", "dbasik-returns") + tmpDir, err := os.MkdirTemp("", "dbasik-returns") if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return -- cgit v1.2.3