Access object key that starts with $

I have a json file where I am accessing some data. Some of the nested data is prefixed with a $. When I attempt to access it:

{{ range $ }}
<div>{{ .author.$location }} - </div>
{{ end }}

I get an error about a bad character.

Is there a better way to access this key?

Thank you in advance.

The ONLY way is via the index func, e.g.:

{{ index .author "$location" }}

Thank you very much!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.