Package goroutinemap can be structurally simplified to be more idiomatic, concise, and free of error potential. No structural changes are made. It is unconventional declare `sync.Mutex` directly as a pointerized field in a parent structure. The `sync.Mutex` operates on pointer receivers of itself; and by relying on that, the types that contain those fields can be safely constructed using https://golang.org/ref/spec#The_zero_value. The duration constants are already of type `time.Duration`, so re-declaring that is redundant.
8.6 KiB
8.6 KiB