Thank you. Yes, I had considered a struct as possibly it will be easier (once I understand it) and more flexible for future growth.
Context
I’m trying to put together an html report of reasonable complexity. The Go code will have to collect in the order of a hundred or so different pieces of data from diverse sources such as databases and REST services. Each response will be subject to further processing in Go to isolate the specific value needed for inclusion in the report. I thought it would be easier, for now, to simply isolate the value as a string and then pop it onto the map with a memorable name for reference in the template. Based on early experimentation, this seems to work extremely well (once I got my immense density over how to actually reference the map key in the template).
Using a struct would, I think ( correct me here, please), require me to ‘type’ the response/value as the struct type and as long as the struct fields are capitalised, they would be exported - right? That would effectively add the value to the field name which matched? A bit like Json marshal/unmarshal - yes?
I probably need to experiment more with casting my required values to the struct and getting more used to working with that model before committing.
Would appreciate any thoughts/advice. Thanks!