From 40e3504777fe3cb25d9c20207c4eda52401b7bcf Mon Sep 17 00:00:00 2001 From: Jonathan Hall Date: Wed, 6 Dec 2017 18:29:51 +0100 Subject: [PATCH] Explain OnInitialize better in the GoDoc --- cobra.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cobra.go b/cobra.go index e4b910c5..7010fd15 100644 --- a/cobra.go +++ b/cobra.go @@ -70,7 +70,8 @@ func AddTemplateFuncs(tmplFuncs template.FuncMap) { } } -// OnInitialize takes a series of func() arguments and appends them to a slice of func(). +// OnInitialize sets the passed functions to be run when each command's +// Execute method is called. func OnInitialize(y ...func()) { initializers = append(initializers, y...) }