Add omitted return after http.Error calls
This commit is contained in:
parent
51aeeb833d
commit
3b523f7742
1 changed files with 2 additions and 0 deletions
2
main.go
2
main.go
|
|
@ -68,6 +68,7 @@ func main() {
|
||||||
err := r.ParseForm()
|
err := r.ParseForm()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, "Could not parse form", http.StatusInternalServerError)
|
http.Error(w, "Could not parse form", http.StatusInternalServerError)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
sidewalkID, err := strconv.Atoi(r.PathValue("id"))
|
sidewalkID, err := strconv.Atoi(r.PathValue("id"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -77,6 +78,7 @@ func main() {
|
||||||
condition, err := strconv.Atoi(r.Form.Get("condition"))
|
condition, err := strconv.Atoi(r.Form.Get("condition"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, "Invalid condition", http.StatusBadRequest)
|
http.Error(w, "Invalid condition", http.StatusBadRequest)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
sidewalksMutex.Lock()
|
sidewalksMutex.Lock()
|
||||||
sidewalks[sidewalkID].Condition = sidewalk.Condition(condition)
|
sidewalks[sidewalkID].Condition = sidewalk.Condition(condition)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue