I have a method with a pointer receiver, I was wondering if using this pointer receiver is safe to use inside a goroutine within this method? or should I pass this pointer receiver as a parameter?
for example:
func (m *dummyStruct) doSomething {
/* do a bunch of stuff */
go func() {
m.a = x
m.doSomethingElse()
}()
return y
}
I know that I can not go wrong by passing m as a parameter to the goroutine but I was wondering if it is extremely necessary