Thank you,
If I understand correctly, newData should be only passed into the channel and not used anywhere else, since it is a pointer. So in such approach the pointer has to be used exculsively through the channel to avoid a race condition.
Also, I have fixed the typos
Eduardo Bonzi da Conceição
Backend Developer
I know this is a simple example but channels don't guarantee exclusive access, if you modify
newData(it being a pointer) anywhere else in your code you'll probably run into a race condition.(Also there a few typos in your code, like the name of the channel in
mainandd.listwhich should bed.numbers).