You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
266 B
Go

package utils
import (
"errors"
"os"
"os/exec"
"runtime"
"strconv"
)
func Reload() error {
if runtime.GOOS == "windows" {
return errors.New("系统不支持")
}
pid := os.Getpid()
cmd := exec.Command("kill", "-1", strconv.Itoa(pid))
return cmd.Run()
}