go vet claims we need a buffered chan for signal
This commit is contained in:
parent
0faedcb9c5
commit
cb7c9d700b
3 changed files with 5 additions and 5 deletions
2
admin.go
2
admin.go
|
@ -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()
|
||||
|
|
6
util.go
6
util.go
|
@ -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
2
web.go
|
@ -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...")
|
||||
|
|
Loading…
Reference in a new issue