It is a data race because calling rpc.version() makes a copy of rpc, which causes reading the field rpc.result concurrently while it is being written by the goroutine.
On Tue, Nov 14, 2023 at 3:59 PM Mike Schinkel <m...@newclarity.net> wrote: > > On Monday, November 13, 2023 at 11:28:00 PM UTC-5 Dan Kortschak wrote: > > https://dave.cheney.net/2015/11/18/wednesday-pop-quiz-spot-the-race > > > Thanks for that link. > > However, after studying it for well more than an hour I cannot figure out why > it is a data race, and unfortunately Dave Cheney didn't explain it in his > post. > > Robert Engels seems to be saying this isn't conceptually a data race but it > is an unfortunate artifact of how the compiler works? > > -Mike > > -- > 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/241c13d1-9d9a-4028-9bce-ba856405f9edn%40googlegroups.com. -- 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/CAMV2RqouBOHsik282BAesvPX2in0i02F4cGFHj1qfywsySTidw%40mail.gmail.com.