blob: 1158ff5fd377a75d52e98c087004735ef3407616 [file] [log] [blame]
package p
import (
"os"
ao "os"
"os/signal"
)
var c = make(chan os.Signal)
var d = make(chan os.Signal, 1)
func f() {
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt) // ok
_ = <-c
}
func g() {
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt) // want "misuse of unbuffered os.Signal channel as argument to signal.Notify"
_ = <-c
}
func h() {
c := make(chan ao.Signal, 1)
signal.Notify(c, os.Interrupt) // want "misuse of unbuffered os.Signal channel as argument to signal.Notify"
_ = <-c
}
func i() {
signal.Notify(d, os.Interrupt) // want "misuse of unbuffered os.Signal channel as argument to signal.Notify"
}
func j() {
c := make(chan os.Signal, 1)
f := signal.Notify
f(c, os.Interrupt) // want "misuse of unbuffered os.Signal channel as argument to signal.Notify"
}
func k() {
signal.Notify(make(chan os.Signal), os.Interrupt) // ok
}
func l() {
signal.Notify(make(chan os.Signal, 1), os.Interrupt) // ok
}
func m() {
signal.Notify(make(chan ao.Signal, 1), os.Interrupt) // ok
}
func n() {
signal.Notify(make(chan ao.Signal), os.Interrupt) // ok
}