Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to have arrays as query params? #8

Open
shutupflanders opened this issue Feb 7, 2023 · 0 comments
Open

Possible to have arrays as query params? #8

shutupflanders opened this issue Feb 7, 2023 · 0 comments

Comments

@shutupflanders
Copy link

It would be great if we could pass arrays into the query parameters, something like:

?var[]=string1&var[]=string2&var[]=string3

So we can then do:

<ul>
  {{ range $key, $value := .var }}
     <li>{{ $value }}</li>
  {{ end }}
</ul>

I'm looking at reducing the amount of duplicated elements in the templates, so looping over a range would be really helpful in this case.

Please note: I'm a complete novice at golang, so sorry If the above example wouldn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant