clean-architecture-go-v2 icon indicating copy to clipboard operation
clean-architecture-go-v2 copied to clipboard

Is using `newInmem` only used for testing?

Open bravecorvus opened this issue 3 years ago • 0 comments

Since you are using stdlib map, in inmem.go inside use cases, I was wondering if this is ever relied on inside of the HTTP Handlers. If so, this would not be thread safe since HTTP Handlers are completely concurrent in go https://golang.org/doc/faq#atomic_maps.

If this is inded the case and you need a solution, you could use sync.Map which is thread safe.

bravecorvus avatar Sep 16 '21 21:09 bravecorvus