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

Please add a simple "get" function for Dicts #151

Closed
bitsofinfo opened this issue May 31, 2019 · 4 comments · Fixed by #197
Closed

Please add a simple "get" function for Dicts #151

bitsofinfo opened this issue May 31, 2019 · 4 comments · Fixed by #197

Comments

@bitsofinfo
Copy link

bitsofinfo commented May 31, 2019

Would be great to just be able to do

{{ $theKeysValue := get $mydict $somekey }}
@bitsofinfo
Copy link
Author

i need this due to dynamic key names

@InvictusMB
Copy link

@bitsofinfo
It is possible to express your case as {{ $theKeysValue := pick $mydict $somekey | values | first }}

@bitsofinfo
Copy link
Author

yes i'm aware and that is what i'm doing, but I think this would be a good feature to add as it is not all that intuitive to someone new to this library.

@mattfarina
Copy link
Member

PRs are welcome to add this.

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

Successfully merging a pull request may close this issue.

3 participants