mirror of
https://github.com/caddyserver/caddy.git
synced 2025-07-09 03:04:57 -04:00
ServeHTTP does not use pointer.
parent
111de04802
commit
f75f773680
@ -36,7 +36,7 @@ type MyHandler struct {
|
|||||||
To implement the `httpserver.Handler` interface, we write a method called ServeHTTP. This method is the actual handler function, and, unless it fully handles the request by itself, it should call the next handler in the chain:
|
To implement the `httpserver.Handler` interface, we write a method called ServeHTTP. This method is the actual handler function, and, unless it fully handles the request by itself, it should call the next handler in the chain:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
func (h *MyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
|
func (h MyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
|
||||||
return h.Next.ServeHTTP(w, r)
|
return h.Next.ServeHTTP(w, r)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user