aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-23 09:48:58 -0500
committerAdnan Maolood <[email protected]>2021-02-23 09:49:20 -0500
commit4e25d2c3f9527dfcbaf4b8dfbe114ae9e937f9e6 (patch)
tree9d3bbe80692ae5847e36a4061962fd6893ecd5fe
parentserver: Fix Shutdown with no active listeners (diff)
downloadgo-gemini-4e25d2c3f9527dfcbaf4b8dfbe114ae9e937f9e6.tar.xz
go-gemini-4e25d2c3f9527dfcbaf4b8dfbe114ae9e937f9e6.zip
ServeMux.HandleFunc: Take a HandlerFunc argument
-rw-r--r--mux.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/mux.go b/mux.go
index 7b449d0..e4ad726 100644
--- a/mux.go
+++ b/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)
}