mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-22 05:12:49 +00:00
23 lines
339 B
Go
23 lines
339 B
Go
package fiber
|
|
|
|
import (
|
|
"os"
|
|
"os/exec"
|
|
)
|
|
|
|
var dummyChildCmd = "go"
|
|
|
|
func dummyCmd() *exec.Cmd {
|
|
return exec.Command("cmd", "/C", dummyChildCmd, "version")
|
|
}
|
|
|
|
// watchMaster finds parent process,
|
|
// and waits for it to exit
|
|
func watchMaster() {
|
|
p, err := os.FindProcess(os.Getppid())
|
|
if err == nil {
|
|
_, _ = p.Wait()
|
|
}
|
|
os.Exit(1)
|
|
}
|