From c156af39849842c87f2ce59882c5f4bd98977c43 Mon Sep 17 00:00:00 2001 From: Jonathan Hall Date: Wed, 6 Dec 2017 19:18:45 +0100 Subject: [PATCH] Explain OnInitialize better in the GoDoc (#594) --- cobra.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cobra.go b/cobra.go index e4b910c..7010fd1 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...) }