You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ go build myprogram.go
$ . <(./myprogram completion bash)
$ ./myprogram
root.RunE:context is not nil - OK
$ ./myprogram son
son.RunE:context is not nil - OK
$ ./myprogram <TAB>
completion root_ValidArgsFunction_context_is_not_nil_OK son
$ ./myprogram son <TAB> son_ValidArgsFunction_context_is_nil_ERROR
The text was updated successfully, but these errors were encountered:
The function command.Context, suppose to return set context or the Background context. Anyway, not nil (
cobra/command.go
Line 222 in 9df156e
However, when I do cmd.Context that given to ValidArgsFunction, I got nil.
Example:
Code
Result
The text was updated successfully, but these errors were encountered: