Files
HackBrowserData/cmd/hack-browser-data/main_others.go
T
Roger 3e9150249c refactor: rename core types and spell out every name (#677)
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.
2026-11-02 11:06:05 +08:00

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)
}