github
95 of 112 new or added lines in 7 files covered. (84.82%)
3 existing lines in 1 file now uncovered.2603 of 2925 relevant lines covered (88.99%)
7.55 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 |
} |