Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestStringer (4.04 sec)

  1. src/html/template/content_test.go

    	return fmt.Sprintf("string=%d", s.v)
    }
    
    type errorer struct {
    	v int
    }
    
    func (s *errorer) Error() string {
    	return fmt.Sprintf("error=%d", s.v)
    }
    
    func TestStringer(t *testing.T) {
    	s := &myStringer{3}
    	b := new(strings.Builder)
    	tmpl := Must(New("x").Parse("{{.}}"))
    	if err := tmpl.Execute(b, s); err != nil {
    		t.Fatal(err)
    	}
    	var expect = "string=3"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 06 15:48:16 UTC 2022
    - 13.5K bytes
    - Viewed (0)
Back to top