@johnpowell thats not necessarily true about it showing. And goldfish are notorious for randomly getting aggressive but they dont really have sharp teeth at all so they dont leave much of a mark. I would definitely agree though to get the water tested first. That should be the first thing you do whenever you notice any problems of any kind in your tank because 9 times out of 10 its related to water quality.
Do you put aquarium salt in your tank? If not I would start it will help the fishes immune system greatly and ime even though mollies are easy fish they tend to randomly die from time to time. Aquarium salt reduces this greatly.
How often do you do water changes on your tank? You should be doing about 10% once a week but possibly even more depending on the size of your tank and current filtration because as @woodcutter said, goldfish are rather dirty fish.
Another question would be what are you keeping the tank temp at? Goldfish generally like colder water where the molly likes 75–80. If the water is cold for the goldfish than this could impact the mollies health. Really these fish shouldnt be together in the first place.
Goldfish like cold freshwater and a pH around 7.5
Mollies, while often sold as freshwater fish, arent. They come from alkaline brackish environments. As stated above the aquarium salt will help a bit but not really in the long run. What is needed for mollies to do good is a higher salinity. I usually keep them around 1.009 (specific gravity) temp 75–80 and pH closer to 8.