mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 05:33:04 +08:00
Update 15.2.md
line 84: HTPP => HTTP
This commit is contained in:
@@ -81,7 +81,7 @@ func HFunc(w http.ResponseWriter, req *http.Request) {
|
|||||||
```go
|
```go
|
||||||
type HandlerFunc func(ResponseWriter, *Request)
|
type HandlerFunc func(ResponseWriter, *Request)
|
||||||
```
|
```
|
||||||
它是一个可以把普通的函数当做HTPP处理器的适配器。如果`f`函数声明的合适,`HandlerFunc(f)`就是一个执行了`f`函数的处理器对象。
|
它是一个可以把普通的函数当做HTTP处理器的适配器。如果`f`函数声明的合适,`HandlerFunc(f)`就是一个执行了`f`函数的处理器对象。
|
||||||
|
|
||||||
`http.Handle`的第二个参数也可以是`T`的一个obj对象:`http.Handle("/", obj)`给T提供了`SereHTTP`方法,实现了http的`Handler`接口:
|
`http.Handle`的第二个参数也可以是`T`的一个obj对象:`http.Handle("/", obj)`给T提供了`SereHTTP`方法,实现了http的`Handler`接口:
|
||||||
```go
|
```go
|
||||||
|
Reference in New Issue
Block a user