Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for titleTest (0.3 sec)

  1. src/text/template/examplefunc_test.go

    Input: {{printf "%q" .}}
    Output 0: {{title .}}
    Output 1: {{title . | printf "%q"}}
    Output 2: {{printf "%q" . | title}}
    `
    
    	// Create a template, add the function map, and parse the text.
    	tmpl, err := template.New("titleTest").Funcs(funcMap).Parse(templateText)
    	if err != nil {
    		log.Fatalf("parsing: %s", err)
    	}
    
    	// Run the template to verify the output.
    	err = tmpl.Execute(os.Stdout, "the go programming language")
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 1.5K bytes
    - Viewed (0)
Back to top