fix recursive get for proper err display

pull/6/head
Mike Metral 2016-05-24 20:05:07 -07:00
parent 39f0c6ba25
commit 950612eb5f
1 changed files with 2 additions and 9 deletions

View File

@ -219,15 +219,8 @@ func RunGet(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string
return err
}
infos := []*resource.Info{}
allErrs := []error{}
err = r.Visit(func(info *resource.Info, err error) error {
if err != nil {
return err
}
infos = append(infos, info)
return nil
})
infos, err := r.Infos()
if err != nil {
allErrs = append(allErrs, err)
}
@ -322,5 +315,5 @@ func RunGet(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string
continue
}
}
return utilerrors.NewAggregate(allErrs)
return utilerrors.Flatten(utilerrors.NewAggregate(allErrs))
}