v
v copied to clipboard
Referring map entries in template files
V version: V 0.2.4 d4b3c65.0d53705 OS: linux, Linux version 5.14.9-200.fc34.x86_64 ([email protected]) (gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1), GNU ld version 2.35.2-5.fc34)
What did you do?
Created a map[string]string variable
lang = {'test_entry' : 'Test Text'}
Next create a template file with the following content:
@lang['test_entry']
What did you expect to see? Test Text
What did you see instead? {'test_entry': 'Test Text'}['test_entry']
Trying other forms didn't work either:
@{lang['test_entry']}
Result in an error: internal_memory:39:8: error: invalid character \
@(lang['test_entry'])
prints: $(lang['test_entry'])