Fix AppendClose

This commit is contained in:
世界 2024-11-26 12:00:56 +08:00
parent 7fd3517e4d
commit 30e9d91b57
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -74,9 +74,10 @@ type ExtendedConn interface {
type CloseHandlerFunc = func(it error)
func AppendClose(parent CloseHandlerFunc, onClose CloseHandlerFunc) CloseHandlerFunc {
if onClose == nil {
panic("nil onClose")
}
if parent == nil {
return parent
} else if onClose == nil {
return onClose
}
return func(it error) {