code: func redirect(pathTemplate string, status int) router.Handler {
  	if !strings.HasPrefix(pathTemplate, "/") {
  		panic("pathTemplate must start with /")
  	}
  
  	return func(c *router.Context) {
  		parts := strings.Split(pathTemplate, "/")
  		for i, p := range parts {
  			if strings.HasPrefix(p, ":") {
  				parts[i] = c.Params.ByName(p[1:])
  			}
  		}
  		u := *c.Request.URL
  		u.Path = strings.Join(parts, "/")
  		http.Redirect(c.Writer, c.Request, u.String(), status)
  	}
  }
docs: // redirect returns a handler that responds with given HTTP status
  // with a location specified by the pathTemplate.