package adverr import ( "fmt" "testing" ) var ( ErrDoStuffFailed = NewErrTmpl("ErrDoStuffFailed", "test error: %s") ) func TestErrTmpl(t *testing.T) { err := doTemplateStuff() fmt.Println(err) } func doTemplateStuff() error { return ErrDoStuffFailed.New("because of reasons") }