pass listen struct to defer func directly
This commit is contained in:
8
main.go
8
main.go
@@ -1323,7 +1323,11 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panicf("Failure listing on %s:%d: %v", l.Host, l.Port, err)
|
log.Panicf("Failure listing on %s:%d: %v", l.Host, l.Port, err)
|
||||||
}
|
}
|
||||||
go func() {
|
go func(l struct {
|
||||||
|
Socket string
|
||||||
|
Host string
|
||||||
|
Port int
|
||||||
|
}) {
|
||||||
srv := &http.Server{
|
srv := &http.Server{
|
||||||
ReadTimeout: time.Duration(conf.Csgowtfd.Timeout.Read) * time.Second,
|
ReadTimeout: time.Duration(conf.Csgowtfd.Timeout.Read) * time.Second,
|
||||||
WriteTimeout: time.Duration(conf.Csgowtfd.Timeout.Write) * time.Second,
|
WriteTimeout: time.Duration(conf.Csgowtfd.Timeout.Write) * time.Second,
|
||||||
@@ -1334,7 +1338,7 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failure serving on %s:%d: %v", l.Host, l.Port, err)
|
log.Fatalf("Failure serving on %s:%d: %v", l.Host, l.Port, err)
|
||||||
}
|
}
|
||||||
}()
|
}(l)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user