From 101d434d4490c740eced15324c99ee29016ea32f Mon Sep 17 00:00:00 2001 From: bogem Date: Tue, 30 Aug 2016 21:58:52 +0500 Subject: [PATCH] Simplify OnInitialize func --- cobra.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cobra.go b/cobra.go index 93a2c0f3..608dc0a1 100644 --- a/cobra.go +++ b/cobra.go @@ -61,9 +61,7 @@ func AddTemplateFuncs(tmplFuncs template.FuncMap) { //OnInitialize takes a series of func() arguments and appends them to a slice of func(). func OnInitialize(y ...func()) { - for _, x := range y { - initializers = append(initializers, x) - } + initializers = append(initializers, y...) } //Gt takes two types and checks whether the first type is greater than the second. In case of types Arrays, Chans,