Key names with minus


I’m reading a JSON file with

{{ range $item := getJSON "data/references.json" }} 

but I have got some keys with - e.g.

   { "id" : "mykey", "container-title" : "a container name" }

I can get access of the values by


but not with


How can I get access to a key with a minus within the key name?



index $item “container-title”

thanks for this, works well, I undstand the “index” first in that way, that it works only for numerical values :slightly_smiling: and not also for string values

Index in this case is a built-in func in Go templates that works for both slices and maps.