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

18 lines
266 B

3 years ago
  1. package utils
  2. import (
  3. "errors"
  4. "os"
  5. "os/exec"
  6. "runtime"
  7. "strconv"
  8. )
  9. func Reload() error {
  10. if runtime.GOOS == "windows" {
  11. return errors.New("系统不支持")
  12. }
  13. pid := os.Getpid()
  14. cmd := exec.Command("kill", "-1", strconv.Itoa(pid))
  15. return cmd.Run()
  16. }