> Shouldn't that result in a panic, even without -race?

It's not *guaranteed* to panic when you make concurrent accesses to the 
same map (hence the point of the race checker).  And having two structs 
refer to the same map is no different to having two variables refer to the 
same map.  

For the OP: one way you could see this problem is if you ever copy 
SearchResults by value:
https://play.golang.org/p/LqwXQQzQ4VN

Note the "go vet" warning here.  Have you tried running "go vet" on your 
code?

On Sunday, 27 June 2021 at 05:40:35 UTC+1 kortschak wrote:

> On Sat, 2021-06-26 at 20:44 -0700, Ian Lance Taylor wrote:
> > Looks like you have multiple SearchResults values that refer to the
> > same map.
>
>
> Shouldn't that result in a panic, even without -race?
>
> Dan
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/40d1ec2f-0c37-4d7c-8ac5-816dc729c39cn%40googlegroups.com.

Reply via email to