Repashy Super Gold, Super Green, or Soilent Green are all great for goldfish. These are gel style foods that come in a powder. You add boiling water and stir to prepare them, and then refrigerate. They're not the most convenient because every batch you make only lasts in the fridge about a week (unless you freeze it), but they are very well formulated, lack the additives that many solid foods have, and they are less likely to cause constipation/blockage issues because they are wet.
Super Gold - Designed by the Dandy Oranda's fancy goldfish importer specifically for goldfish.
Super Green - Freshwater food with a high spirulina algae content and lower protein levels. Recommended for older fish.
Soilent Green - Freshwater food with high spirulina algae and high protein. Recommended for fry, juveniles, and goldfish that have a wen and need extra protein.
A lot of people will mix super green and soilent green half and half, thinking it's the ideal balance. I don't actually know how Super Gold compares nutritionally speaking.
Omega 1 Sinking pellets are pretty much the best pellets on the market as far as I know for goldfish nutrition. Of course, that could have always changed since I did my research!
Flakes are only worth feeding to very young and small fish in a pinch. They leech nutrients into the water very quickly.