Closed Richard1ybb closed 3 years ago
Event2FurcasTicketCreate = "kapal.furcas.ticket.create" event.On("*", &kapal.DefaultNotify) // not work event.On("kapal.furcas.ticket*", &kapal.DefaultNotify) // not work event.On(kapal.Event2FurcasTicketReset, &kapal.DefaultNotify) // work
这是最小可复现代码
type test_notify struct {} var is_Run = false func (notify *test_notify) Handle(e event.Event) error { is_Run = true return nil } func TestTicketCreate_Handle_1(t *testing.T) { TestNotify := test_notify{} event.On("*", &TestNotify) err, _ := event.Fire("test_notify", event.M{}) assert.Nil(t, err) assert.NotEqual(t, is_Run, true) event.On("test_notify", &TestNotify) err, _ = event.Fire("test_notify", event.M{}) assert.Nil(t, err) assert.Equal(t, is_Run, true) }
感谢,修复了。你更新版本试试
这是最小可复现代码