aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-06-03 21:12:31 +0100
committerMatthew Lemon <y@yulqen.org>2024-06-03 21:12:31 +0100
commit4c248acc185740c535bc7dc14ae9a363cac3382f (patch)
tree4165382e68d24602b7d9549c26e1832d920f2e36
parentd2d2a57bb78af71182c6bcd66007b3850c9dbcfa (diff)
Couple of minor fixes
-rw-r--r--cmd/dbasik-api/handlers.go5
1 files 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