# Annoying VS Code "error"

**URL:** <https://forum.golangbridge.org/t/annoying-vs-code-error/33210>\
**Category:** Getting Help\
**Created:** [October 2, 2023, 6:55am UTC](https://forum.golangbridge.org/t/annoying-vs-code-error/33210 "2023-10-02T06:55:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sibert](https://forum.golangbridge.org/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@Sibert](https://forum.golangbridge.org/u/Sibert)\
**Post date:** [October 2, 2023, 6:55am UTC](https://forum.golangbridge.org/t/annoying-vs-code-error/33210/1 "2023-10-02T06:55:41Z")

</div>

I have a built in function within a Go template. The function works without any execution errors, but VS Code claims there is an error.

 ![image](https://forum.golangbridge.org/uploads/default/original/2X/5/5ee162389e37a9900244c86d771fd8b0334ee986.jpeg)

And the terminal shows an error:

> Unexpected keyword or identifier.

I have installed “Go for Visual Studio Code”, but it seems not recognize functions in the templates. Any tips how to get rid of this “error”?

---

<div class="post-metadata">

**Author:** ![hollowaykeanho](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/hollowaykeanho/32/15191_2.png) [@hollowaykeanho](https://forum.golangbridge.org/u/hollowaykeanho)\
**Post date:** [October 2, 2023, 7:11am UTC](https://forum.golangbridge.org/t/annoying-vs-code-error/33210/2 "2023-10-02T07:11:49Z")

</div>

Shouldn’t there be a space before the `chart`? as in:

```auto
{{ chart "..." }}

```

Not

```auto
{{chart "..." }}

```

---

<div class="post-metadata">

**Author:** ![Sibert](https://forum.golangbridge.org/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@Sibert](https://forum.golangbridge.org/u/Sibert)\
**Post date:** [October 2, 2023, 9:02am UTC](https://forum.golangbridge.org/t/annoying-vs-code-error/33210/3 "2023-10-02T09:02:34Z")

</div>

> [@hollowaykeanho](#):
>
> space before the `chart`

Does not matter. The code works perfect, but VS Code report an error.

 ![image](https://forum.golangbridge.org/uploads/default/original/2X/7/7de5ec4de780e43e309d067032fa16e4321d2f31.png)

---

<div class="post-metadata">

**Author:** ![Dean\_Davidson](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/dean_davidson/32/9685_2.png) [@Dean\_Davidson](https://forum.golangbridge.org/u/Dean_Davidson)\
**Post date:** [October 2, 2023, 2:51pm UTC](https://forum.golangbridge.org/t/annoying-vs-code-error/33210/4 "2023-10-02T14:51:33Z")

</div>

Is that in a .go file or something like an .html file? It looks to me like it’s an html file and thus it has nothing to do with the Go for Visual Studio plugin. VSCode is trying to verify that it’s valid HTML and thus is validating the stuff between `<script>` tags is valid JavaScript.

---

<div class="post-metadata">

**Author:** ![system](https://forum.golangbridge.org/uploads/default/original/2X/5/5ad234f7c3dbc68b6cc72d338ce4f2973d9fd81c.png) [@system](https://forum.golangbridge.org/u/system)\
**Post date:** [December 31, 2023, 2:51pm UTC](https://forum.golangbridge.org/t/annoying-vs-code-error/33210/5 "2023-12-31T14:51:39Z")

</div>

Closed on December 31, 2023, 2:51pm UTC

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