Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 504 for funcMap (0.17 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. api/go1.19.txt

    pkg hash/maphash, func Bytes(Seed, []uint8) uint64 #42710
    pkg hash/maphash, func String(Seed, string) uint64 #42710
    pkg html/template, method (*Template) Funcs(template.FuncMap) *Template #46121
    pkg html/template, type FuncMap = template.FuncMap #46121
    pkg net/http, method (*MaxBytesError) Error() string #30715
    pkg net/http, type MaxBytesError struct #30715
    pkg net/http, type MaxBytesError struct, Limit int64 #30715
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 02 16:29:41 UTC 2022
    - 17.9K bytes
    - Viewed (0)
Back to top