I have a method with a pointer receiver, I was wondering if this pointer receiver can be used for use inside the goroutine inside this method? or should I pass this pointer receiver as a parameter?
eg:
func (m *dummyStruct) doSomething {
go func() {
m.a = x
m.doSomethingElse()
}()
return y
}
I know that I cannot be mistaken by passing m as a parameter in goroutine, but I was wondering if it is absolutely necessary
Keeto source
share