# Error with function "in"

**URL:** <https://discourse.gohugo.io/t/error-with-function-in/1866>\
**Category:** support\
**Created:** [October 12, 2015, 2:24am UTC](https://discourse.gohugo.io/t/error-with-function-in/1866 "2015-10-12T02:24:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DimShadoWWW](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dimshadowww/32/765_2.png) [@DimShadoWWW](https://discourse.gohugo.io/u/DimShadoWWW)\
**Post date:** [October 12, 2015, 2:24am UTC](https://discourse.gohugo.io/t/error-with-function-in/1866/1 "2015-10-12T02:24:21Z")

</div>

Hello, I’m checking if an element is included in an array but it’s not working… I’m out of ideas of what can be the problem

this is the code in the layout\>

```auto
{{ $v := substr .Permalink -3 -1 }}
{{ printf "%#v" $v }}
{{ printf "%#v" .Site.Params.lang }}
{{ in .Site.Params.lang "es" }}
{{ in .Site.Params.lang $v }}

```

output:

```auto
"es" []interface {}{"en", "es"} false false

```

url: [http://localhost:1313/lang/es/](http://localhost:1313/lang/es/)

config.yml:

```auto
[params]
  default_lang = "en"
  lang = ["en", "es", "it"]

```

---

<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:** [October 12, 2015, 1:38pm UTC](https://discourse.gohugo.io/t/error-with-function-in/1866/2 "2015-10-12T13:38:42Z")

</div>

Could you print the type of one of the values in `.Site.Params.lang`? printf “%T” …

---

<div class="post-metadata">

**Author:** ![DimShadoWWW](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dimshadowww/32/765_2.png) [@DimShadoWWW](https://discourse.gohugo.io/u/DimShadoWWW)\
**Post date:** [October 12, 2015, 2:36pm UTC](https://discourse.gohugo.io/t/error-with-function-in/1866/3 "2015-10-12T14:36:51Z")

</div>

code:

```auto
{{ $v := substr .Permalink -3 -1 }}
{{ printf "%#v" $v }}
{{ printf "%#v" .Site.Params.lang }}
{{ printf "%T" $v }}
{{ index .Site.Params.lang 0|printf "%T" }}
{{ in .Site.Params.lang "es" }}
{{ in .Site.Params.lang $v }}

```

output:

```auto
"es" []interface {}{"en", "es"} string string false false

```

---

<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:** [October 12, 2015, 4:01pm UTC](https://discourse.gohugo.io/t/error-with-function-in/1866/4 "2015-10-12T16:01:08Z")

</div>

It’s a bug:

> <https://github.com/gohugoio/hugo/issues/1486>

It might behave differently between JSON, TOML and YAML, though.

---

<div class="post-metadata">

**Author:** ![DimShadoWWW](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dimshadowww/32/765_2.png) [@DimShadoWWW](https://discourse.gohugo.io/u/DimShadoWWW)\
**Post date:** [October 13, 2015, 2:23pm UTC](https://discourse.gohugo.io/t/error-with-function-in/1866/5 "2015-10-13T14:23:47Z")

</div>

Thank you, bep
