We've successfully kept mollies and fantails together for YEAAAARS! The goldfish grow, and the mollies breed d: So I think that practically there's not a big problem keeping them together, but theoretically, they have different needs of water quality, but both goldfish and mollies are quite hardy fish.
At home we've been feeding them with goldfish pellets, and some tropical fish flakes + freeze dried live foods once in a while, no problems! (: The water's kept on 26 degrees Celsius, and both kinds thrive. I saw the molly female give birth last time I changed the water for them d:
So as long as the tank is big enough, there shouldn't be a problem (: Think something a bit bigger than 20 gallons and you should be ready to go!