Skip to content

Commit 0501cf8

Browse files
committed
cli-plugins/manager: simplify ctx-cancel check
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 5343bdc commit 0501cf8

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

cli-plugins/manager/hooks.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,8 @@ func runHooks(ctx context.Context, cfg *configfile.ConfigFile, rootCmd, subComma
5555
}
5656

5757
func invokeAndCollectHooks(ctx context.Context, cfg *configfile.ConfigFile, rootCmd, subCmd *cobra.Command, subCmdStr string, flags map[string]string, cmdErrorMessage string) []string {
58-
// check if the context was cancelled before invoking hooks
59-
select {
60-
case <-ctx.Done():
58+
if ctx.Err() != nil {
6159
return nil
62-
default:
6360
}
6461

6562
pluginsCfg := cfg.Plugins

0 commit comments

Comments
 (0)