diff --git a/event/event.go b/event/event.go index ce1b03d52..25a2c2e45 100644 --- a/event/event.go +++ b/event/event.go @@ -61,7 +61,7 @@ func (mux *TypeMux) Subscribe(types ...interface{}) *TypeMuxSubscription { close(sub.postC) } else { if mux.subm == nil { - mux.subm = make(map[reflect.Type][]*TypeMuxSubscription) + mux.subm = make(map[reflect.Type][]*TypeMuxSubscription, len(types)) } for _, t := range types { rtyp := reflect.TypeOf(t)