Re: [go-nuts] Parse JSON in Template

2017-02-19 Thread Rejoy Nair
Yes, there could be ways to do it. I could have used Javascript to access the JSON data values. But couldn't get that to work either. So the easier thing for me to do was to unmarshal the string again into a map([string]interface{}) type which is what I finally did to get the code to work. Thanks f

Re: [go-nuts] Parse JSON in Template

2017-02-19 Thread Hugh S. Myers
The devil sitting on my shoulder tempts me to say "Of course, there is" and walk away. That said, by now there must exist code to read JSON (YAML, Windows config files, etc.) from a string. It's just a matter of finding it. - https://gobyexample.com/json - https://blog.golang.org/json-and-go

[go-nuts] Parse JSON in Template

2017-02-19 Thread Rejoy
I am retrieving a set of field values from the Database into an interface type object. One of the field values is a JSON string (say Order detail). I am retrieving it as a string as passing it on to a template and referencing it using {{.orderdetail}} this is the output I get on the client which