On Thu, 2017-02-02 at 15:15 -0800, Rejoy wrote:
> I 'd like to unmarshal database records into a struct type. I get the
> error "json:
> cannot unmarshal array into Go value of type main..".
>
> Working example
https://play.golang.org/p/keY-3z7lyA
>
> I can unmarshal the data to []map[String]string, but cannot reference
> it
> using key value pairs in the template.
>
> The snippet for code in the template:
> <div class="container">
> {{ range $key, $value := . }}
> <li><strong>{{ $key }}</strong>: {{ $value }}</li>
> {{ end }}
> </div>
>
> The output that I get on the webserver:
>