code: func (t *TemplateFuncsNamespace) AddMethodMapping(m interface{}, aliases []string, examples [][2]string) {
  	if t.MethodMappings == nil {
  		t.MethodMappings = make(map[string]TemplateFuncMethodMapping)
  	}
  
  	name := methodToName(m)
  
  	// sanity check
  	for _, e := range examples {
  		if e[0] == "" {
  			panic(t.Name + ": Empty example for " + name)
  		}
  	}
  	for _, a := range aliases {
  		if a == "" {
  			panic(t.Name + ": Empty alias for " + name)
  		}
  	}
  
  	t.MethodMappings[name] = TemplateFuncMethodMapping{
  		Method:   m,
  		Aliases:  aliases,
  		Examples: examples,
  	}
  
  }
docs: // AddMethodMapping adds a method to a template function namespace.