- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 532 for funcMap (0.27 sec)
-
cmd/gotemplate/gotemplate.go
var buf bytes.Buffer if _, err := buf.ReadFrom(in); err != nil { return fmt.Errorf("reading input: %v", err) } funcMap := template.FuncMap{ "include": include, "indent": indent, "trim": trim, } tmpl, err := template.New("").Funcs(funcMap).Parse(buf.String()) if err != nil { return fmt.Errorf("parsing input as text template: %v", err) }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Aug 22 18:39:23 UTC 2023 - 2.6K bytes - Viewed (0) -
src/text/template/template.go
// It is legal to overwrite elements of the map. The return value is the template, // so calls can be chained. func (t *Template) Funcs(funcMap FuncMap) *Template { t.init() t.muFuncs.Lock() defer t.muFuncs.Unlock() addValueFuncs(t.execFuncs, funcMap) addFuncs(t.parseFuncs, funcMap) return t } // Lookup returns the template with the given name that is associated with t.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 20:57:51 UTC 2024 - 7.2K bytes - Viewed (0) -
pkg/bootstrap/instance.go
func newTemplate(templateFilePath string) (*template.Template, error) { cfgTmpl, err := os.ReadFile(templateFilePath) if err != nil { return nil, err } funcMap := template.FuncMap{ "toJSON": toJSON, } return template.New("bootstrap").Funcs(funcMap).Funcs(sprig.GenericFuncMap()).Parse(string(cfgTmpl))
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Thu Mar 28 20:38:02 UTC 2024 - 3.9K bytes - Viewed (0) -
src/text/template/funcs.go
} // createValueFuncs turns a FuncMap into a map[string]reflect.Value func createValueFuncs(funcMap FuncMap) map[string]reflect.Value { m := make(map[string]reflect.Value) addValueFuncs(m, funcMap) return m } // addValueFuncs adds to values the functions in funcs, converting them to reflect.Values. func addValueFuncs(out map[string]reflect.Value, in FuncMap) { for name, fn := range in { if !goodName(name) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 24 22:23:55 UTC 2024 - 20.9K bytes - Viewed (0) -
src/sort/gen_sort_variants.go
// `j` of the value `name`. Funcs template.FuncMap } var ( traditionalVariants = []Variant{ Variant{ Name: "interface", Path: "zsortinterface.go", Package: "sort", Imports: "", FuncSuffix: "", TypeParam: "", ExtraParam: "", ExtraArg: "", DataType: "Interface", Funcs: template.FuncMap{ "Less": func(name, i, j string) string {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:27 UTC 2023 - 19.6K bytes - Viewed (0) -
src/html/template/template.go
// type. However, it is legal to overwrite elements of the map. The return // value is the template, so calls can be chained. func (t *Template) Funcs(funcMap FuncMap) *Template { t.text.Funcs(template.FuncMap(funcMap)) return t } // Delims sets the action delimiters to the specified strings, to be used in // subsequent calls to [Template.Parse], [ParseFiles], or [ParseGlob]. Nested template
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 21 21:00:46 UTC 2024 - 17K bytes - Viewed (0) -
src/html/template/escape.go
return s } } for i, arg := range args { args[i] = indirectToStringerOrError(arg) } return fmt.Sprint(args...) } // funcMap maps command names to functions that render their inputs safe. var funcMap = template.FuncMap{ "_html_template_attrescaper": attrEscaper, "_html_template_commentescaper": commentEscaper, "_html_template_cssescaper": cssEscaper,
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Oct 02 15:18:39 UTC 2023 - 32.4K bytes - Viewed (0) -
pkg/kube/inject/template.go
"istio.io/istio/pkg/config/mesh" "istio.io/istio/pkg/log" "istio.io/istio/pkg/util/protomarshal" ) var InjectionFuncmap = createInjectionFuncmap() func createInjectionFuncmap() template.FuncMap { return template.FuncMap{ "formatDuration": formatDuration, "isset": isset, "excludeInboundPort": excludeInboundPort, "includeInboundPorts": includeInboundPorts, "kubevirtInterfaces": kubevirtInterfaces,
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Thu Nov 16 02:12:03 UTC 2023 - 9.9K bytes - Viewed (0) -
src/html/template/example_test.go
func ExampleTemplate_block() { const ( master = `Names:{{block "list" .}}{{"\n"}}{{range .}}{{println "-" .}}{{end}}{{end}}` overlay = `{{define "list"}} {{join . ", "}}{{end}} ` ) var ( funcs = template.FuncMap{"join": strings.Join} guardians = []string{"Gamora", "Groot", "Nebula", "Rocket", "Star-Lord"} ) masterTmpl, err := template.New("master").Funcs(funcs).Parse(master) if err != nil { log.Fatal(err) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 13 18:45:54 UTC 2021 - 3.9K bytes - Viewed (0) -
pkg/config/schema/codegen/common.go
c.Stdout = os.Stdout c.Stderr = os.Stderr return c.Run() } func applyTemplate(tmpl string, i any) (string, error) { t := template.New("tmpl").Funcs(template.FuncMap{ "contains": strings.Contains, }) t2 := template.Must(t.Parse(tmpl)) var b bytes.Buffer if err := t2.Execute(&b, i); err != nil { return "", err } return b.String(), nil
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Sat Mar 30 00:31:03 UTC 2024 - 4.5K bytes - Viewed (0)