var httpmuxgo121 … var use121 … // Read httpmuxgo121 once at startup, since dealing with changes to it during // program execution is too complex and error-prone. func init() { … } type serveMux121 … type muxEntry … // Formerly ServeMux.Handle. func (mux *serveMux121) handle(pattern string, handler Handler) { … } func appendSorted(es []muxEntry, e muxEntry) []muxEntry { … } // Formerly ServeMux.HandleFunc. func (mux *serveMux121) handleFunc(pattern string, handler func(ResponseWriter, *Request)) { … } // Formerly ServeMux.Handler. func (mux *serveMux121) findHandler(r *Request) (h Handler, pattern string) { … } // handler is the main implementation of findHandler. // The path is known to be in canonical form, except for CONNECT methods. func (mux *serveMux121) handler(host, path string) (h Handler, pattern string) { … } // Find a handler on a handler map given a path string. // Most-specific (longest) pattern wins. func (mux *serveMux121) match(path string) (h Handler, pattern string) { … } // redirectToPathSlash determines if the given path needs appending "/" to it. // This occurs when a handler for path + "/" was already registered, but // not for path itself. If the path needs appending to, it creates a new // URL, setting the path to u.Path + "/" and returning true to indicate so. func (mux *serveMux121) redirectToPathSlash(host, path string, u *url.URL) (*url.URL, bool) { … } // shouldRedirectRLocked reports whether the given path and host should be redirected to // path+"/". This should happen if a handler is registered for path+"/" but // not path -- see comments at ServeMux. func (mux *serveMux121) shouldRedirectRLocked(host, path string) bool { … }