1
0
Fork 0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-04-19 16:33:58 +02:00

ServeMux.HandleFunc: Take a HandlerFunc argument

This commit is contained in:
Adnan Maolood 2021-02-23 09:48:58 -05:00
parent 5ab7617efd
commit 4e25d2c3f9

7
mux.go
View File

@ -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)
}