code: func (m *RouteMux) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
  
  	requestPath := r.URL.Path
  
  	//wrap the response writer, in our custom interface
  	w := &responseWriter{writer: rw}
  
  	//find a matching Route
  	for _, route := range m.routes {
  
  		//if the methods don't match, skip this handler
  		//i.e if request.Method is 'PUT' Route.Method must be 'PUT'
  		if r.Method != route.method {
  			continue
  		}
  
  		//check if Route pattern matches url
  		if !route.regex.MatchString(requestPath) {
  			continue
  		}
  
  		//get submatches (params)
  		matches := route.regex.FindStringSubmatch(requestPath)
  
  		//double check that the Route matches the URL pattern.
  		if len(matches[0]) != len(requestPath) {
  			continue
  		}
  
  		if len(route.params) > 0 {
  			//add url parameters to the query param map
  			values := r.URL.Query()
  			for i, match := range matches[1:] {
  				values.Add(route.params[i], match)
  			}
  
  			//reassemble query params and add to RawQuery
  			r.URL.RawQuery = url.Values(values).Encode() + "&" + r.URL.RawQuery
  			//r.URL.RawQuery = url.Values(values).Encode()
  		}
  
  		//execute middleware filters
  		for _, filter := range m.filters {
  			filter(w, r)
  			if w.started {
  				return
  			}
  		}
  
  		//Invoke the request handler
  		route.handler(w, r)
  		break
  	}
  
  	//if no matches to url, throw a not found exception
  	if w.started == false {
  		http.NotFound(w, r)
  	}
  }
docs: // Required by http.Handler interface. This method is invoked by the
  // http server and will handle all page routing