We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4250b42 commit 326b7baCopy full SHA for 326b7ba
builder.go
@@ -73,8 +73,7 @@ func Name(obj any) string {
73
return commandName
74
}
75
76
-func Main(cmd *cobra.Command) {
77
- ctx := SetupSignalContext()
+func MainCtx(ctx context.Context, cmd *cobra.Command) {
78
if err := cmd.ExecuteContext(ctx); err != nil {
79
if strings.EqualFold("interrupt", err.Error()) || errors.Is(err, context.Canceled) {
80
os.Exit(1)
@@ -83,6 +82,10 @@ func Main(cmd *cobra.Command) {
83
82
84
85
+func Main(cmd *cobra.Command) {
86
+ MainCtx(SetupSignalContext(), cmd)
87
+}
88
+
89
// Command populates a cobra.Command object by extracting args from struct tags of the
90
// Runnable obj passed. The Run method is assigned to the RunE of the command.
91
// children should be either Runnable or *cobra.Command
0 commit comments