From 380782a995a14caf8c5da0aad074a0535a8d506b Mon Sep 17 00:00:00 2001 From: Wayne Warren Date: Thu, 20 Dec 2018 10:24:59 -0600 Subject: [PATCH] Fix OnInitializeE --- cobra.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cobra.go b/cobra.go index e3a3f732..34ec8017 100644 --- a/cobra.go +++ b/cobra.go @@ -80,7 +80,7 @@ func OnInitialize(y ...func()) { // OnInitializeE sets the passed functions to be run when each command's // Execute method is called. func OnInitializeE(y ...func() error) { - initializers = append(initializers, y...) + initializersWithError = append(initializersWithError, y...) } // FIXME Gt is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra.