I'm newbie in Go and practicing, could you please help to convert a map to an html table in GO? I have a function that fetches some data from some rest end points and return a map that can vary in size based on the result I get back from the endpoints.
type color struct {
blue int
red int
}
func fetchData() map[string]map[string]colour {}
printing out the output of this function looks like this but can vary each time with more or less columns
map[joe:map[alex: {3 6} may:{2 6}] jena:map[fred: {1 2}]]
I would to have a html table like this:
| Teacher | Student | Blue Pens | Red Pens |
|---|---|---|---|
| joe | alex | 3 | 6 |
| may | 2 | 6 | |
| jena | fred | 1 | 2 |