diff options
| author | Adnan Maolood <[email protected]> | 2021-02-23 09:48:58 -0500 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2021-02-23 09:49:20 -0500 |
| commit | 4e25d2c3f9527dfcbaf4b8dfbe114ae9e937f9e6 (patch) | |
| tree | 9d3bbe80692ae5847e36a4061962fd6893ecd5fe | |
| parent | server: Fix Shutdown with no active listeners (diff) | |
| download | go-gemini-4e25d2c3f9527dfcbaf4b8dfbe114ae9e937f9e6.tar.xz go-gemini-4e25d2c3f9527dfcbaf4b8dfbe114ae9e937f9e6.zip | |
ServeMux.HandleFunc: Take a HandlerFunc argument
| -rw-r--r-- | mux.go | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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) } |