mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
Fixes #41884
I can confirm this change fixes my issue.
I can't confirm that this doesn't break any and everything else.
I see that this code has been tweaked repeatedly, so I would really welcome guidance into further testing.
Change-Id: I1986dd0c2f30cfe10257f0d8c658988d6986f7a6
GitHub-Last-Rev: 92f02c9697
GitHub-Pull-Request: golang/go#41886
Reviewed-on: https://go-review.googlesource.com/c/go/+/261057
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
19 lines
222 B
Go
19 lines
222 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"os/signal"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
c := make(chan os.Signal, 1)
|
|
signal.Notify(c)
|
|
|
|
fmt.Println("ready")
|
|
sig := <-c
|
|
|
|
time.Sleep(time.Second)
|
|
fmt.Println(sig)
|
|
}
|