-- 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()           //@ diag(`cannot be trapped`)
	signal.Ignore(os.Kill)    //@ diag(`cannot be trapped`)
	signal.Notify(c, os.Kill) //@ diag(`cannot be trapped`)
	signal.Reset(os.Kill)     //@ diag(`cannot be trapped`)
	signal.Ignore()           //@ diag(`cannot be trapped`)
	signal.Notify(c)          //@ diag(`cannot be trapped`)
	signal.Reset()            //@ diag(`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)) //@ diag(`cannot be trapped`)
	signal.Ignore()                           //@ diag(`cannot be trapped`)
	signal.Notify(c)                          //@ diag(`cannot be trapped`)
	signal.Reset()                            //@ diag(`cannot be trapped`)
	signal.Ignore(syscall.SIGKILL)            //@ diag(`cannot be trapped`)
	signal.Notify(c, syscall.SIGKILL)         //@ diag(`cannot be trapped`)
	signal.Reset(syscall.SIGKILL)             //@ diag(`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)    //@ diag(`cannot be trapped`)
	signal.Ignore(os.Kill)            //@ diag(`cannot be trapped`)
	signal.Notify(c, os.Kill)         //@ diag(`cannot be trapped`)
	signal.Reset(os.Kill)             //@ diag(`cannot be trapped`)
	signal.Ignore(syscall.SIGTERM)    //@ diag(`cannot be trapped`)
	signal.Notify(c, syscall.SIGTERM) //@ diag(`cannot be trapped`)
	signal.Reset(syscall.SIGTERM)     //@ diag(`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)) //@ diag(`cannot be trapped`)
	signal.Ignore(syscall.SIGTERM)            //@ diag(`cannot be trapped`)
	signal.Notify(c, syscall.SIGTERM)         //@ diag(`cannot be trapped`)
	signal.Reset(syscall.SIGTERM)             //@ diag(`cannot be trapped`)
	signal.Ignore(syscall.SIGKILL)            //@ diag(`cannot be trapped`)
	signal.Notify(c, syscall.SIGKILL)         //@ diag(`cannot be trapped`)
	signal.Reset(syscall.SIGKILL)             //@ diag(`cannot be trapped`)
}
