mirror of
https://github.com/spf13/cobra
synced 2024-11-24 22:57:12 +00:00
Explain OnInitialize better in the GoDoc (#594)
This commit is contained in:
parent
de2d9c4eca
commit
c156af3984
1 changed files with 2 additions and 1 deletions
3
cobra.go
3
cobra.go
|
@ -70,7 +70,8 @@ func AddTemplateFuncs(tmplFuncs template.FuncMap) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// OnInitialize takes a series of func() arguments and appends them to a slice of func().
|
// OnInitialize sets the passed functions to be run when each command's
|
||||||
|
// Execute method is called.
|
||||||
func OnInitialize(y ...func()) {
|
func OnInitialize(y ...func()) {
|
||||||
initializers = append(initializers, y...)
|
initializers = append(initializers, y...)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue