We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func makeFn(a int) event.ListenerFunc { return func(e event.Event) error { fmt.Println(a) return nil } } func main() { evBus := event.NewManager("") f1 := makeFn(11) evBus.On("evt1", f1) f2 := makeFn(22) evBus.On("evt1", f2) evBus.RemoveListener("evt1", f1) // DON'T REMOVE ALL !!! evBus.MustFire("evt1", event.M{"arg0": "val0", "arg1": "val1"}) }
The text was updated successfully, but these errors were encountered:
The issue is that "%p" is equal for f1 and f2.
"%p"
f1
f2
You can work around this issue by using new:
new
f1 := makeFn(11) l := new(event.ListenerFunc) *l = f1 evBus.On("evt1", l) f2 := makeFn(22) evBus.On("evt1", f2)
Sorry, something went wrong.
Merge pull request #41 from RelicOfTesla/master
9fbb081
fix #9
inhere
Successfully merging a pull request may close this issue.
The text was updated successfully, but these errors were encountered: