Fixes for obfuscated2

This commit is contained in:
9seconds
2021-03-18 17:15:55 +03:00
parent 0ad2d61742
commit 0330a0e5cd
14 changed files with 335 additions and 19 deletions
+23
View File
@@ -0,0 +1,23 @@
// +build windows
package utils
import (
"context"
"os"
"os/signal"
)
func RootContext() context.Context {
ctx, cancel := context.WithCancel(context.Background())
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, os.Interrupt)
go func() {
for range sigChan {
cancel()
}
}()
return ctx
}