I don't know about a goldfish, but I can tell you for sure that my parrot cichlid has quite a good memory.

I'm the one that feeds him, so if someone comes in the room, he checks to see who it is. He swims up to the glass, and if it's anyone other than me, he swims away and hides behind the plants. If it's me, he goes straight to the corner of the tank where I always feed him, and goes up to the top, waiting for me to drop his food in.