To use callbacks in Go you must follow Functional Programming rules about shared data. In simple terms, you cannot share data. You can pass pointers to shared data structures, and likely will have to but as soon as you start using also goroutines you will end up with race conditions. To solve this problem the best way usually will be to create a collection of functions that isolate this state data from callers and ensures that changes to it are not clobbered by other threads.
It is not outside the scope of Go idiom to use callbacks, as you may be familiar with the laws of Go - don't share state to communicate, communicate to share state. On Saturday, 5 May 2018 03:53:13 UTC+3, Eduardo Moseis Fuentes wrote: > > HI everyone I´m Eduardo from Guatemala and I'm beginer. I'm interesting > in all scope golang in fact I was download a little book about it, but I > need learn more about callbacks because the book don´t has enough > information on callbacks. May somebody tell me where can I find more > information?. HELP ME PLEASE THANKS God Bless you > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
