From b4dbd37a01839e0653eec12aa4bbb2a2ce7b2a37 Mon Sep 17 00:00:00 2001 From: Albert Nigmatzianov Date: Mon, 12 Jun 2017 08:36:10 +0200 Subject: [PATCH] cmd: Fix tests --- cobra/cmd/init.go | 8 ++++---- cobra/cmd/testdata/root.go.golden | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cobra/cmd/init.go b/cobra/cmd/init.go index d2b841f..4e7ebdb 100644 --- a/cobra/cmd/init.go +++ b/cobra/cmd/init.go @@ -142,10 +142,10 @@ package cmd import ( "fmt" "os" - - "github.com/spf13/cobra"{{if .viper}} - "github.com/spf13/viper" +{{if .viper}} homedir "github.com/mitchellh/go-homedir"{{end}} + "github.com/spf13/cobra"{{if .viper}} + "github.com/spf13/viper"{{end}} ){{if .viper}} var cfgFile string{{end}} @@ -176,7 +176,7 @@ func Execute() { func init() { {{if .viper}} cobra.OnInitialize(initConfig) - {{end}} +{{end}} // Here you will define your flags and configuration settings. // Cobra supports persistent flags, which, if defined here, // will be global for your application.{{ if .viper }} diff --git a/cobra/cmd/testdata/root.go.golden b/cobra/cmd/testdata/root.go.golden index 13e9a77..0085d5a 100644 --- a/cobra/cmd/testdata/root.go.golden +++ b/cobra/cmd/testdata/root.go.golden @@ -48,7 +48,7 @@ func Execute() { } } -func init() { +func init() { cobra.OnInitialize(initConfig) // Here you will define your flags and configuration settings.