From 4c1a8198dfcbe5e55fb6c9099eb3b0f1dfe7450b Mon Sep 17 00:00:00 2001 From: yxxhero <11087727+yxxhero@users.noreply.github.com> Date: Thu, 23 Nov 2023 17:10:21 +0800 Subject: [PATCH] update get and getOrNil docs (#1164) Signed-off-by: yxxhero --- docs/templating_funcs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/templating_funcs.md b/docs/templating_funcs.md index 8e055de0..d525c493 100644 --- a/docs/templating_funcs.md +++ b/docs/templating_funcs.md @@ -93,14 +93,14 @@ The `setValueAtPath` function allows you to set a value at a path. When has fail ``` #### `get` -The `get` function allows you to get a value at a path. when defaultValue not set. It will return nil. When has failed, the template rendering will fail with an error message. +The `get` function allows you to get a value at a path. you can set a default value when the path is not found. When has failed, the template rendering will fail with an error message. ```yaml {{ $Getvalue := $value | get "path.key" "defaultValue" }} ``` #### `getOrNil` -The `getOrNil` function allows you to get a value at a path. when defaultValue not set. It will return nil. When has failed, the template rendering will fail with an error message. +The `getOrNil` function allows you to get a value at a path. it will return nil when the value of path is not found. When has failed, the template rendering will fail with an error message. ```yaml {{ $GetOrNlvalue := $value | getOrNil "path.key" }}