49
}
50
for _, def := range lib.EventDefinitions() {
51
>
if existing, ok := r.eventDefinitions[def.Type()]; ok {
registry.go
52
return fmt.Errorf("%w: event handler for %v: %v", ErrDuplicateRegistration, def.Type(), existing)
53
}
55
>
for goType.Kind() == reflect.Pointer {
56
goType = goType.Elem()
57
}
58
>
if existing, ok := r.eventDefinitionsByGoType[goType]; ok {
registry.go
59
return fmt.Errorf("%w: event definition for Go type %v: %v", ErrDuplicateRegistration, goType, existing)
60
}
62
>
r.eventDefinitionsByGoType[goType] = def
63
}
64
return nil