Standard library / text/template
text/template.ExecError.Error()
Returns the formatted evaluation error text. Expected stdout: 'demo failure\n'.
Formal Syntax & Structure
go syntaxgo
func (e ExecError) Error() stringReturn Value
string
Returns the formatted evaluation error text.
Working Example
Example Snippetgo
package main
import ( "errors" "fmt" "text/template")
func main() { e := template.ExecError{Name: "x", Err: errors.New("demo failure")} fmt.Println(e.Error())}