ServeMux.HandleFunc: Take a HandlerFunc argument
This commit is contained in:
parent
5ab7617efd
commit
4e25d2c3f9
7
mux.go
7
mux.go
@ -294,9 +294,6 @@ func appendSorted(es []muxEntry, e muxEntry) []muxEntry {
|
||||
}
|
||||
|
||||
// HandleFunc registers the handler function for the given pattern.
|
||||
func (mux *ServeMux) HandleFunc(pattern string, handler func(context.Context, ResponseWriter, *Request)) {
|
||||
if handler == nil {
|
||||
panic("gemini: nil handler")
|
||||
}
|
||||
mux.Handle(pattern, HandlerFunc(handler))
|
||||
func (mux *ServeMux) HandleFunc(pattern string, handler HandlerFunc) {
|
||||
mux.Handle(pattern, handler)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user