package main import "fmt" type Counter struct { value int } func (c Counter /** value reciever **/) toString() string { return fmt.Sprintf("Counter Value: %d", c.value) } func (c *Counter /**Pointer reciever**/) Increment() { fmt.Printf("Inside Increment: %p\n", c) c.value = c.value + 1 } func main() { c := Counter{} fmt.Println(c) c.Increment() fmt.Println(c) }