Using golang r60 template package to range over a slice of maps



Output is:

levels: [
    {bitrate:896, file:"small.mp4", width:480, height:272}
    {bitrate:1000, file:"medium.mp4", width:1280, height:720}
    {bitrate:2128, file:"large.mp4", width:1920, height:1080}
]

Wasn't very obvious to me that you access the keys with $h.bitrate.  I was trying $h[bitrate].

No comments:

Post a Comment