github
82 of 91 new or added lines in 7 files covered. (90.11%)
3 existing lines in 1 file now uncovered.2599 of 2913 relevant lines covered (89.22%)
7.61 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 |
} |