databricks-cli/libs/template/helpers.go

17 lines
382 B
Go
Raw Normal View History

2023-05-17 09:53:13 +00:00
package template
2023-05-15 09:25:01 +00:00
import (
"errors"
"text/template"
)
2023-05-17 13:33:04 +00:00
var errSkipThisFile = errors.New("skip generating this file")
2023-05-15 09:25:01 +00:00
var HelperFuncs = template.FuncMap{
2023-07-04 14:01:47 +00:00
// Text template execution returns the error only if it's the second return
// value from a function: https://pkg.go.dev/text/template#hdr-Pipelines
2023-07-04 13:59:25 +00:00
"skipThisFile": func() (any, error) {
return nil, errSkipThisFile
2023-05-15 09:25:01 +00:00
},
}