-
-
Notifications
You must be signed in to change notification settings - Fork 754
Closed
Labels
area: docsChanges related to documentation.Changes related to documentation.
Description
Description
Documentation example
task/website/src/docs/reference/templating.md
Line 630 in 599591a
| - echo "Database {{.CONFIG | get "database"}}" |
Gives the next error:
template: :1:31: executing "" at <"database">: can't handle "database" for arg of type map[string]interface {}
It appears that the argument order of the get and hasKey functions in the documentation example may be incorrect or bugged.
those changes made in example provides a correct result
cmds:
- echo "Database {{"database" | get .CONFIG}}"
- echo "Keys {{.CONFIG | keys}}"
- echo "Has SSL {{"ssl" | hasKey .CONFIG}}"
- echo "{{dict "env" "prod" "debug" false}}"Version
3.45.3
Operating system
dnf/linux_amd64
Experiments Enabled
No response
Example Taskfile
# https://taskfile.dev
version: '3'
tasks:
dict:
vars:
CONFIG:
map:
database: postgres
port: 5432
ssl: true
cmds:
- echo "Database {{.CONFIG | get "database"}}"
- echo "Keys {{.CONFIG | keys}}"
- echo "Has SSL {{.CONFIG | hasKey "ssl"}}"
- echo "{{dict "env" "prod" "debug" false}}"Metadata
Metadata
Assignees
Labels
area: docsChanges related to documentation.Changes related to documentation.