Skip to content

Commit c156af3

Browse files
flimzyn10v
authored andcommitted
Explain OnInitialize better in the GoDoc (#594)
1 parent de2d9c4 commit c156af3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cobra.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ func AddTemplateFuncs(tmplFuncs template.FuncMap) {
7070
}
7171
}
7272

73-
// OnInitialize takes a series of func() arguments and appends them to a slice of func().
73+
// OnInitialize sets the passed functions to be run when each command's
74+
// Execute method is called.
7475
func OnInitialize(y ...func()) {
7576
initializers = append(initializers, y...)
7677
}

0 commit comments

Comments
 (0)