Re: [go-nuts] text/template: Can't call method/function with 0 results.

2021-04-09 Thread 'Thomas Bushnell BSG' via golang-nuts
I find the current behavior clearer. What would you like a no-valued function to insert in the template? Even if it was the zero value, that could be the string-typed zero value, or the int-typed zero value, and so forth. It could be defined, but why not make it explicit if you want it to insert n

[go-nuts] text/template: Can't call method/function with 0 results.

2021-04-09 Thread 'Johnny Jacobs' via golang-nuts
Hello all, Is there any reason you can't use a custom function with no return value in Go templates? You get a "Can't call method/function with 0 results." if you try to call such a function. FuncMap requires functions to either return a value,