diff options
Diffstat (limited to 'internal/ior.go')
| -rw-r--r-- | internal/ior.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/ior.go b/internal/ior.go index 0de3636..0b52340 100644 --- a/internal/ior.go +++ b/internal/ior.go @@ -91,11 +91,12 @@ func Run(flags flags.Flags) { fmt.Println("Probing for", duration) ctx, cancel := context.WithTimeout(context.Background(), duration) - c := make(chan os.Signal, 1) - signal.Notify(c, os.Interrupt, syscall.SIGTERM) + signalCh := make(chan os.Signal, 1) + signal.Notify(signalCh, os.Interrupt, syscall.SIGTERM) go func() { - <-c + <-signalCh + fmt.Println("Received signal, shutting down...") cancel() }() |
