From f7ca52dfc8584ec26f8617ffb7d65280aebf4ffc Mon Sep 17 00:00:00 2001 From: Sam Leavens Date: Thu, 20 Jul 2017 13:59:28 -0700 Subject: [PATCH] ref(pkg/chartutil): improve comment for PathValue Make comment for PathValue more explanatory. --- pkg/chartutil/values.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/chartutil/values.go b/pkg/chartutil/values.go index a857dea6a..257d28c24 100644 --- a/pkg/chartutil/values.go +++ b/pkg/chartutil/values.go @@ -388,7 +388,13 @@ func istable(v interface{}) bool { return ok } -// PathValue takes a yaml path with . notation and returns the value if exists +// PathValue takes a path that traverses a YAML structure and returns the value at the end of that path. +// The path starts at the root of the YAML structure and is comprised of YAML keys separated by periods. +// Given the following YAML data the value at path "chapter.one.title" is "Loomings". +// +// chapter: +// one: +// title: "Loomings" func (v Values) PathValue(ypath string) (interface{}, error) { if len(ypath) == 0 { return nil, errors.New("YAML path string cannot be zero length")