mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net/http,doc: use HTTP status code constants where applicable
There are a few places where the integer value is used.
Use the equivalent constants to aid with readability.
Change-Id: I023b1dbe605340544c056d0e0d9d6d5a7d7d0edc
GitHub-Last-Rev: c1c90bcd25
GitHub-Pull-Request: golang/go#24123
Reviewed-on: https://go-review.googlesource.com/96984
Reviewed-by: Andrew Bonventre <andybons@golang.org>
This commit is contained in:
parent
39852bf4cc
commit
e9c57bea11
3 changed files with 5 additions and 5 deletions
|
|
@ -33,7 +33,7 @@ type appHandler func(http.ResponseWriter, *http.Request) error
|
|||
|
||||
func (fn appHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
if err := fn(w, r); err != nil {
|
||||
http.Error(w, err.Error(), 500)
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue