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
18 lines
266 B
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()
|
|
}
|