go vet claims we need a buffered chan for signal

This commit is contained in:
Ted Unangst 2023-07-02 14:08:26 -04:00
parent 0faedcb9c5
commit cb7c9d700b
3 changed files with 5 additions and 5 deletions

View file

@ -125,7 +125,7 @@ func adminscreen() {
}
defer restore()
go func() {
sig := make(chan os.Signal)
sig := make(chan os.Signal, 1)
signal.Notify(sig, os.Interrupt)
<-sig
restore()

View file

@ -90,7 +90,7 @@ func initdb() {
os.Remove(dbname)
os.Exit(1)
}()
c := make(chan os.Signal)
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
go func() {
<-c
@ -209,7 +209,7 @@ func adduser() {
defer func() {
os.Exit(1)
}()
c := make(chan os.Signal)
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
go func() {
<-c
@ -263,7 +263,7 @@ func chpass(username string) {
defer func() {
os.Exit(1)
}()
c := make(chan os.Signal)
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
go func() {
<-c

2
web.go
View file

@ -2567,7 +2567,7 @@ var readyalready = make(chan bool)
var workinprogress = 0
func enditall() {
sig := make(chan os.Signal)
sig := make(chan os.Signal, 1)
signal.Notify(sig, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
<-sig
ilog.Printf("stopping...")