func encodeJSON(data interface{}) template.JS {
a, err := json.Marshal(data)
if err != nil { panic(err) }

return template.JS(a)
}

// code for rendering ELEMENT

func (ele *ELEMENT) Render() ([]byte, error) {

// init map of functions available to use within delimiters

if funcMap == nil {
funcMap = template.FuncMap{
"divideFF": divideFF,
"percentageFF": percentageFF,
"percentageIF": percentageIF,
"encodeJSON": encodeJSON,
}
}

when executing only the encodeJSON function I get this: template: x:19: 
function "encodeJSON" not defined

all others work fine, and I checked the correct code is in my gopath.

please advise... I had the encodeJSON func returning a string before but it 
didn't work either

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to