Good question.
Goldfish are omnivorous, will eat bloodworms etc but also vegetables. apart from the regular feed of pellets and bloodworms (should be given as treat and not frequently) feeding vegetables helps to avoid stress on their intestine (they dont have stomach, everthing passes through intestine) and prevents malnutrition i.e feeding Only 1 type of food. this goldfish will appear v lazy and inactive.
I feed my goldfish Blanched spinach (lettuce) leaves, blanched cucumber and really boild and peeled green peas.
Try to pick very young vegetables, like if spinach, make sure its very thin leafed and young, if cucumber, make sure it is very small or no seeds, boil this stuff till it feels slimy/gooey i.e very easy to tear of. I boil spinach leaves for 2 mins in boiling water then leave it in the hot water for another 3 mins, this cooks it up nicely. same with cucumber, boil it for 4-5 mins then leave then leave it for another 4-5 mins. i make sure it doesnt start coming apart when blanching/boiling.
After blanching/boiling, i pour out the hot-water, slowly fill in cool/normal water , rinse it and hang this deliciousness on side of tank, my goldfish pair go bonkers on it, and they can stay satisfied for full 2 days , i.e they dont go crazy feeding on pellets till its 48 hours. they keep eating small proportion of food for next day.
This vegan feeding has allowed me to keep my goldfish tank planted. my goldies have now got used to very soft blanched green things, so now they dont attack my plants and simply nibble on it and find it hard. BTW they have kinda taken a liking to cabomba and maybe i wont be able to keep that one, but still, for now its plenty in the tank and hope it keeps growing back as it get eaten.
Bonus :
YouTube - Goldfish going crazy for blanched spinach