func (t *TemplateFuncsNamespace) AddMethodMapping(m interface{}, aliases []string, examples [][2]string) {
	if t.MethodMappings == nil {
		t.MethodMappings = make(map[string]TemplateFuncMethodMapping)
	}
	name := methodToName(m)
	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,
	}
}
AddMethodMapping adds a method to a template function namespace.
package internal
import (
	"github.com/flysnow-org/soha/deps"
	"path/filepath"
	"reflect"
	"runtime"
	"strings"
)
var TemplateFuncsNamespaceRegistry []func(d *deps.Deps) *TemplateFuncsNamespace
func AddTemplateFuncsNamespace(ns func(d *deps.Deps) *TemplateFuncsNamespace) {
	TemplateFuncsNamespaceRegistry = append(TemplateFuncsNamespaceRegistry, ns)
}
type TemplateFuncsNamespace struct {
	Name string
	Context func(v ...interface{}) interface{}
	MethodMappings map[string]TemplateFuncMethodMapping
}
type TemplateFuncsNamespaces []*TemplateFuncsNamespace