func loadTemplates() error { var err error t = template.New("").Funcs(template.FuncMap{ "json": func(v interface{}) (string, error) { b, err := json.Marshal(v) return string(b), err }, "updateSupported": func() bool { return updater != nil }, "commitID": func(commitID string) string { return commitID[:8] }, }) t, err = vfstemplate.ParseGlob(assets, t, "/assets/*.tmpl") return err }
func loadTemplates() (*template.Template, error) { t := template.New("").Funcs(template.FuncMap{}) t, err := vfstemplate.ParseGlob(assets, t, "/assets/*.tmpl") return t, err }