golang 模板 - 默认语义如何

golang template - how are the semantics for default

看helm charts,经常有这样的东西:

{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}

我在模板文档中找不到有关默认 函数 (?) 的任何信息:

https://golang.org/pkg/text/template/

它的语义是什么?有什么可能的争论吗?

来自图书馆sprig, which is used by Helm. Quoting the docs:

default "foo" .Bar 

In the above, if .Bar evaluates to a non-empty value, it will be used. But if it is empty, foo will be returned instead.