aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-06-01 15:18:25 +0100
committerMatthew Lemon <y@yulqen.org>2024-06-01 15:23:27 +0100
commit609f6597f1a11cdf35b3ad2da588336226863047 (patch)
tree39cffdcf69844a9871eac2ed3ac75e8e6c730495
parent351a8ba75519d18a8afe06f8a3a3f239f3a62a64 (diff)
Spelling fixes and adds a newline
Adds a mere newline... Fixes spelling mistakes
-rw-r--r--cmd/dbasik-api/handlers.go2
-rw-r--r--cmd/dbasik-api/helpers.go12
2 files changed, 7 insertions, 7 deletions
diff --git a/cmd/dbasik-api/handlers.go b/cmd/dbasik-api/handlers.go
index 65bf2c4..a36adf6 100644
--- a/cmd/dbasik-api/handlers.go
+++ b/cmd/dbasik-api/handlers.go
@@ -100,7 +100,7 @@ func (app *application) createReturnHandler(w http.ResponseWriter, r *http.Reque
app.serverErrorResponse(w, r, err)
}
- fmt.Fprintf(w, "file successfully uploaded")
+ fmt.Fprintf(w, "file successfully uploaded\n")
}
diff --git a/cmd/dbasik-api/helpers.go b/cmd/dbasik-api/helpers.go
index 68d9f66..25671d6 100644
--- a/cmd/dbasik-api/helpers.go
+++ b/cmd/dbasik-api/helpers.go
@@ -36,7 +36,7 @@ func validateSpreadsheetCell(cellRef string) bool {
type envelope map[string]interface{}
// writeJSON)Pretty() helper for sending responses - pretty prints output. This takes the destination http.ResponseWriter, the
-// HTTP status code to sned, the data to encode to JSON and a header map containing any additional
+// HTTP status code to send, the data to encode to JSON and a header map containing any additional
// HTTP headers we want to include in the response.
func (app *application) writeJSONPretty(w http.ResponseWriter, status int, data envelope, headers http.Header) error {
// Encode the data to JSON, returing the error if there was one.
@@ -45,14 +45,14 @@ func (app *application) writeJSONPretty(w http.ResponseWriter, status int, data
return err
}
- // Append a newline to make it easier tro view in terminal applications
+ // Append a newline to make it easier to view in terminal applications
js = append(js, '\n')
// We know now that we won't encounter any more errors before writing the response,
// so it's safe to add any headers that we want to include. We loop through the
// header map and add each header to the http.ResponseWriter header map.
// Note that it's okay if the provided header map is nil. Go doesn't throw an error
- // if you wanmt to try to range over (or more generally reader from) a nil map.
+ // if you want to try to range over (or more generally reader from) a nil map.
for key, value := range headers {
w.Header()[key] = value
}
@@ -66,7 +66,7 @@ func (app *application) writeJSONPretty(w http.ResponseWriter, status int, data
}
// writeJSON() helper for sending responses. This takes the destination http.ResponseWriter, the
-// HTTP status code to sned, the data to encode to JSON and a header map containing any additional
+// HTTP status code to send, the data to encode to JSON and a header map containing any additional
// HTTP headers we want to include in the response.
func (app *application) writeJSON(w http.ResponseWriter, status int, data any, headers http.Header) error {
// Encode the data to JSON, returing the error if there was one.
@@ -75,14 +75,14 @@ func (app *application) writeJSON(w http.ResponseWriter, status int, data any, h
return err
}
- // Append a newline to make it easier tro view in terminal applications
+ // Append a newline to make it easier to view in terminal applications
js = append(js, '\n')
// We know now that we won't encounter any more errors before writing the response,
// so it's safe to add any headers that we want to include. We loop through the
// header map and add each header to the http.ResponseWriter header map.
// Note that it's okay if the provided header map is nil. Go doesn't throw an error
- // if you wanmt to try to range over (or more generally reader from) a nil map.
+ // if you want to try to range over (or more generally reader from) a nil map.
for key, value := range headers {
w.Header()[key] = value
}