mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-12-04 05:43:27 +01:00
Def, Request, DirID, and Source said too little, and short variables and doc comments that skip their name hid intent. varnamelen and staticcheck ST1020-22 now keep both from coming back.
22 lines
521 B
Go
22 lines
521 B
Go
//go:build !windows
|
|
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
"os/signal"
|
|
"syscall"
|
|
"time"
|
|
)
|
|
|
|
func configureDoubleClickMode() {}
|
|
|
|
// exitBy ends the process by sig itself, as the signal would have, so a calling shell or script sees it was stopped.
|
|
func exitBy(received os.Signal) {
|
|
signal.Reset(received)
|
|
if syscallSignal, ok := received.(syscall.Signal); ok && syscall.Kill(syscall.Getpid(), syscallSignal) == nil {
|
|
time.Sleep(time.Second) // the signal ends the process first unless it was ignored at start
|
|
}
|
|
os.Exit(1)
|
|
}
|