Skip to content

Commit

Permalink
Closing a request body in a handler is unnecessary
Browse files Browse the repository at this point in the history
Closes #31
  • Loading branch information
peterbourgon committed Sep 25, 2014
1 parent a27b4fa commit 83ea6f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion roshi-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ func handleSelect(selecter farm.Selecter) http.HandlerFunc {
}

var keys [][]byte
defer r.Body.Close()
if err := json.NewDecoder(r.Body).Decode(&keys); err != nil {
respondError(w, r.Method, r.URL.String(), http.StatusBadRequest, err)
return
}

keyStrings := make([]string, len(keys))
for i := range keys {
keyStrings[i] = string(keys[i])
Expand Down

0 comments on commit 83ea6f0

Please sign in to comment.