Documentation ¶ Index ¶ type Engine func New(viewDir, ext string, reload bool) *Engine func NewWithFS(fs fs.FS, ext string, funcMap template.FuncMap) *Engine func (engine *Engine) AddFunc(funcName string, funcEntry any) func (engine *Engine) Ext() string func (engine *Engine) HTML(writer io.Writer, name string, binding map[string]any) error Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Engine ¶ type Engine struct { sync.Once *template.Template // contains filtered or unexported fields } func New ¶ func New(viewDir, ext string, reload bool) *Engine func NewWithFS ¶ func NewWithFS(fs fs.FS, ext string, funcMap template.FuncMap) *Engine NewWithFS 基于Fs对象创建模板 由于调用ParseFS创建template对象, funcMap必须在调用时传入, 否则可能会出现无法解析函数 func (*Engine) AddFunc ¶ func (engine *Engine) AddFunc(funcName string, funcEntry any) func (*Engine) Ext ¶ func (engine *Engine) Ext() string func (*Engine) HTML ¶ func (engine *Engine) HTML(writer io.Writer, name string, binding map[string]any) error Source Files ¶ View all Source files view.go Click to show internal directories. Click to hide internal directories.