I have type Counter struct { n int } with a method func (c Counter) Inc() { c.n++ }. Calling c.Inc() three times leaves c.n at 0. Changing the receiver to (c *Counter) fixes it, but then assigning a Counter value to my Incrementer interface fails with "Counter does not implement Incrementer (method Inc has pointer receiver)".
What are the rules for choosing between value and pointer receivers, why does the interface assignment break, and is passing pointers everywhere faster or slower in Go?




