Go methods have receivers. Receiver can be a pointer type. A method with the signature, for example:
func (r *R) foo(bar baz) // A method
is the same as
func foo(r *R, bar baz) // A plain old function
In other words, the receiver, pointer or not, is just an argument slot. Your question now reduces to:
What happens when two go routines call the above function with the same value of r?
A: It depends. Problem configurations:
foo
is not re-entrant for any reason.foo
mutates*r
(the pointee) w/o coordination/synchronization.- The last point is only a special case of: If
foo
mutates any shared state w/o coordination/synchronization: anything can happen.
If foo
avoids the above tar pits then it is safe for being executed concurrently by multiple goroutines even with the same value of r.