On Fri, Mar 3, 2017 at 2:34 AM, <scau.myz...@gmail.com> wrote: > Hey guys, > > Here is my code, > https://github.com/myzhan/boomer/blob/dc6893a72c2b32c27ff6d7646a55b135493ba7e1/stats.go#L33 > > I'm trying to figure out why I got nil from "this.Entries(a map)", and I'm > really confused. > > I hava checked if the key exists, and if not, I put a new key in > "this.Entries". > > If "clearAll" is called, "this.Entries" will be repalced by a new map. > > "init()" starts a goroutine to do all the things, get a entry from > "this.Entries" or call "clearAll". > > Is it a concurrency issue?
I haven't looked at your code, but have you run it with the race detector? https://blog.golang.org/race-detector . Ian -- 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 golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.