Skip to content

Commit 4cfcf8f

Browse files
authored
refactor: rename root.Execute to root.ExecuteContext (#57)
1 parent d3cbc44 commit 4cfcf8f

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

cmd/root.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,10 @@ func InitConfig(ctx context.Context, clients *shared.ClientFactory, rootCmd *cob
323323
return clients.IO.InitLogFile(ctx)
324324
}
325325

326-
// Execute sets up a cancellable context for use with IOStreams' interrupt channel. It also
327-
// listens for process interrupts and sends to IOStreams' GetInterruptChannel() for use in
326+
// ExecuteContext sets up a cancellable context for use with IOStreams' interrupt channel.
327+
// It listens for process interrupts and sends to IOStreams' GetInterruptChannel() for use in
328328
// in communicating process interrupts elsewhere in the code.
329-
func Execute(ctx context.Context, rootCmd *cobra.Command, clients *shared.ClientFactory) {
329+
func ExecuteContext(ctx context.Context, rootCmd *cobra.Command, clients *shared.ClientFactory) {
330330
ctx, cancel := context.WithCancel(ctx)
331331

332332
completedChan := make(chan bool, 1) // completed is used for signalling an end to command

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func main() {
7373
ctx = slackcontext.SetOpenTracingSpan(ctx, span)
7474

7575
rootCmd, clients := cmd.Init(ctx)
76-
cmd.Execute(ctx, rootCmd, clients)
76+
cmd.ExecuteContext(ctx, rootCmd, clients)
7777
}
7878

7979
// TODO(slackcontext) Use closure to pass in the ctx, which includes the sessionID

0 commit comments

Comments
 (0)