A few code corrections

Matt Holt 2015-04-25 17:53:03 -06:00
parent a8d58f0970
commit 56c629ef89

@ -14,15 +14,15 @@ Handlers are usually a struct with at least one field, the next Handler in the c
```go
type MyHandler struct {
Next middleware.HandlerFunc
Next middleware.Handler
}
```
It must implement the middleware.Handler interface. We do this by adding a method called ServeHTTP, which happens to be a middlware.HandlerFunc. Right now, let's just pass the request to the next Handler in the chain:
It must also implement the middleware.Handler interface. We do this by adding a method called ServeHTTP. Right now, let's just pass the request to the next Handler in the chain:
```go
func (h MyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
return h.Next(w, r)
return h.Next.ServeHTTP(w, r)
}
```