go的http包

来源:互联网 发布:网络写手笔名 编辑:程序博客网 时间:2024/04/28 03:18

type Handler interface {    ServeHTTP(ResponseWriter, *Request)}type HandlerFunc func(ResponseWriter, *Request)  HandlerFunc为特定函数类型
The HandlerFunc type is an adapter to allow the use of ordinary functions as HTTP handlers.
 If f is a function with the appropriate signature, HandlerFunc(f) is a Handler that calls f.
func (f HandlerFunc) ServeHTTP(w ResponseWriter, r *Request)ServeHTTP calls f(w, r).  ServeHTTP调用该方法


原创粉丝点击