summaryrefslogtreecommitdiff
path: root/vendor/github.com/spf13/cobra/cobra.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2025-02-17 11:43:32 +0000
committerLibravatar GitHub <noreply@github.com>2025-02-17 11:43:32 +0000
commitc73497b58ca6e9cf085b91649ccf12c8389baf5c (patch)
tree9e3e4537a6648e1f3009f76a7483a009cc3e58ff /vendor/github.com/spf13/cobra/cobra.go
parent[chore]: Bump golang.org/x/net from 0.34.0 to 0.35.0 (#3804) (diff)
downloadgotosocial-c73497b58ca6e9cf085b91649ccf12c8389baf5c.tar.xz
[chore]: Bump github.com/spf13/cobra from 1.8.1 to 1.9.1 (#3805)
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.8.1 to 1.9.1. - [Release notes](https://github.com/spf13/cobra/releases) - [Commits](https://github.com/spf13/cobra/compare/v1.8.1...v1.9.1) --- updated-dependencies: - dependency-name: github.com/spf13/cobra dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/spf13/cobra/cobra.go')
-rw-r--r--vendor/github.com/spf13/cobra/cobra.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/vendor/github.com/spf13/cobra/cobra.go b/vendor/github.com/spf13/cobra/cobra.go
index e0b0947b0..d9cd2414e 100644
--- a/vendor/github.com/spf13/cobra/cobra.go
+++ b/vendor/github.com/spf13/cobra/cobra.go
@@ -176,12 +176,16 @@ func rpad(s string, padding int) string {
return fmt.Sprintf(formattedString, s)
}
-// tmpl executes the given template text on data, writing the result to w.
-func tmpl(w io.Writer, text string, data interface{}) error {
- t := template.New("top")
- t.Funcs(templateFuncs)
- template.Must(t.Parse(text))
- return t.Execute(w, data)
+func tmpl(text string) *tmplFunc {
+ return &tmplFunc{
+ tmpl: text,
+ fn: func(w io.Writer, data interface{}) error {
+ t := template.New("top")
+ t.Funcs(templateFuncs)
+ template.Must(t.Parse(text))
+ return t.Execute(w, data)
+ },
+ }
}
// ld compares two strings and returns the levenshtein distance between them.