github
87 of 104 new or added lines in 7 files covered. (83.65%)
3 existing lines in 1 file now uncovered.2604 of 2926 relevant lines covered (89.0%)
7.54 hits per line
1 |
//go:build !wasip1
|
|
2 |
|
|
3 |
package main
|
|
4 |
|
|
5 |
import (
|
|
6 |
"context"
|
|
7 |
"os"
|
|
8 |
"os/signal"
|
|
9 |
) |
|
10 |
|
|
11 |
func SigIntHandler(ctx context.Context, cancel func()) { |
12✔ |
12 |
// translate ^C (Interrput) in ctx.Done()
|
12✔ |
13 |
c := make(chan os.Signal, 1) |
12✔ |
14 |
signal.Notify(c, os.Interrupt) // NOT WITH WASM!
|
12✔ |
15 |
select {
|
12✔ |
UNCOV
16
|
case <-c:
|
× |
UNCOV
17
|
cancel() |
× |
18 |
case <-ctx.Done():
|
× |
19 |
} |
|
20 |
|
|
UNCOV
21
|
signal.Stop(c) |
× |
22 |
} |