-- remove syscall.SIGKILL from list of arguments -- package main import ( "os" "os/signal" "syscall" ) func fn() { c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt) signal.Ignore() // want `cannot be trapped` signal.Ignore(os.Kill) // want `cannot be trapped` signal.Notify(c, os.Kill) // want `cannot be trapped` signal.Reset(os.Kill) // want `cannot be trapped` signal.Ignore() // want `cannot be trapped` signal.Notify(c) // want `cannot be trapped` signal.Reset() // want `cannot be trapped` } -- remove os.Kill from list of arguments -- package main import ( "os" "os/signal" "syscall" ) func fn() { c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt) signal.Ignore(os.Signal(syscall.SIGKILL)) // want `cannot be trapped` signal.Ignore() // want `cannot be trapped` signal.Notify(c) // want `cannot be trapped` signal.Reset() // want `cannot be trapped` signal.Ignore(syscall.SIGKILL) // want `cannot be trapped` signal.Notify(c, syscall.SIGKILL) // want `cannot be trapped` signal.Reset(syscall.SIGKILL) // want `cannot be trapped` } -- use syscall.SIGTERM instead of syscall.SIGKILL -- package main import ( "os" "os/signal" "syscall" ) func fn() { c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt) signal.Ignore(syscall.SIGTERM) // want `cannot be trapped` signal.Ignore(os.Kill) // want `cannot be trapped` signal.Notify(c, os.Kill) // want `cannot be trapped` signal.Reset(os.Kill) // want `cannot be trapped` signal.Ignore(syscall.SIGTERM) // want `cannot be trapped` signal.Notify(c, syscall.SIGTERM) // want `cannot be trapped` signal.Reset(syscall.SIGTERM) // want `cannot be trapped` } -- use syscall.SIGTERM instead of os.Kill -- package main import ( "os" "os/signal" "syscall" ) func fn() { c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt) signal.Ignore(os.Signal(syscall.SIGKILL)) // want `cannot be trapped` signal.Ignore(syscall.SIGTERM) // want `cannot be trapped` signal.Notify(c, syscall.SIGTERM) // want `cannot be trapped` signal.Reset(syscall.SIGTERM) // want `cannot be trapped` signal.Ignore(syscall.SIGKILL) // want `cannot be trapped` signal.Notify(c, syscall.SIGKILL) // want `cannot be trapped` signal.Reset(syscall.SIGKILL) // want `cannot be trapped` }