Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestExecError_CustomError (0.28 sec)

  1. src/text/template/exec_test.go

    		t.Errorf("expected\n%q\ngot\n%q", want, got)
    	}
    }
    
    type CustomError struct{}
    
    func (*CustomError) Error() string { return "heyo !" }
    
    // Check that a custom error can be returned.
    func TestExecError_CustomError(t *testing.T) {
    	failingFunc := func() (string, error) {
    		return "", &CustomError{}
    	}
    	tmpl := Must(New("top").Funcs(FuncMap{
    		"err": failingFunc,
    	}).Parse("{{ err }}"))
    
    	var b bytes.Buffer
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 22:23:55 UTC 2024
    - 60.1K bytes
    - Viewed (0)
Back to top