File tree Expand file tree Collapse file tree 3 files changed +36
-5
lines changed
Expand file tree Collapse file tree 3 files changed +36
-5
lines changed Original file line number Diff line number Diff line change 22
33このディレクトリには以下のサンプルがあります。
44
5- | file | example name | note |
6- | ------------------| -------------------------| ----------------------------------------------|
7- | notify.go | signal\_ notify | signal.Notify のサンプルです |
8- | notifycontext.go | signal\_ notify\_ context | Go 1.16 から追加された signal.NotifyContext のサンプルです |
9-
5+ | file | example name | note |
6+ | ---------------- | --------------------- | ---------------------------------------------------------- |
7+ | notify.go | signal_notify | signal.Notify のサンプルです |
8+ | notifycontext.go | signal_notify_context | Go 1.16 から追加された signal.NotifyContext のサンプルです |
Original file line number Diff line number Diff line change @@ -35,4 +35,20 @@ func Notify() error {
3535 }
3636
3737 return nil
38+
39+ /*
40+ $ task
41+ task: Task "build" is up to date
42+ task: [run] ./try-golang -onetime
43+
44+ ENTER EXAMPLE NAME: signal_notify
45+
46+ [Name] "signal_notify"
47+ ^C[Interrupt] Ctrl-C
48+ task: Signal received: "interrupt"
49+
50+
51+ [Elapsed] 1.771348899s
52+ */
53+
3854}
Original file line number Diff line number Diff line change @@ -36,4 +36,20 @@ func NotifyContext() error {
3636 }
3737
3838 return nil
39+
40+ /*
41+ $ task
42+ task: [build] go build .
43+ task: [run] ./try-golang -onetime
44+
45+ ENTER EXAMPLE NAME: signal_notify_context
46+
47+ [Name] "signal_notify_context"
48+ ^Ctask: Signal received: "interrupt"
49+ [Interrupt] Ctrl-C
50+
51+
52+ [Elapsed] 1.113577647s
53+ */
54+
3955}
You can’t perform that action at this time.
0 commit comments