signal

最后更新于:2022-04-02 02:45:23

[TOC] ## 实例 ### 指定信号 ``` c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt) // Block until a signal is received. s := <-c fmt.Println("Got signal:", s) ``` ### allSignals ``` c := make(chan os.Signal, 1) signal.Notify(c) s := <-c fmt.Println("Got signal:", s) ```
';