mirror of https://github.com/spf13/cobra.git
Simplify OnInitialize func
This commit is contained in:
parent
71a9c0834b
commit
101d434d44
4
cobra.go
4
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,
|
||||
|
|
Loading…
Reference in New Issue