# Key names with minus

**URL:** <https://discourse.gohugo.io/t/key-names-with-minus/3614>\
**Category:** support\
**Created:** [July 4, 2016, 9:48am UTC](https://discourse.gohugo.io/t/key-names-with-minus/3614 "2016-07-04T09:48:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashpixx](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/flashpixx/32/1795_2.png) [@flashpixx](https://discourse.gohugo.io/u/flashpixx)\
**Post date:** [July 4, 2016, 9:48am UTC](https://discourse.gohugo.io/t/key-names-with-minus/3614/1 "2016-07-04T09:48:09Z")

</div>

Hello,

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

```
$item.id

```

but not with

```
$item.container-title
$item.(container-title)
$item."container-title"

```

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

Thanks

Phil

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [July 4, 2016, 11:00am UTC](https://discourse.gohugo.io/t/key-names-with-minus/3614/2 "2016-07-04T11:00:53Z")

</div>

> [@flashpixx](#):
>
> $item.container-title

index $item “container-title”

---

<div class="post-metadata">

**Author:** ![flashpixx](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/flashpixx/32/1795_2.png) [@flashpixx](https://discourse.gohugo.io/u/flashpixx)\
**Post date:** [July 4, 2016, 12:39pm UTC](https://discourse.gohugo.io/t/key-names-with-minus/3614/3 "2016-07-04T12:39:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [July 4, 2016, 12:40pm UTC](https://discourse.gohugo.io/t/key-names-with-minus/3614/4 "2016-07-04T12:40:08Z")

</div>

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