My fish have done this occasionly.
It could be that they don't like their food. Have you tried giving them variety? Tried different brands? Try different things out. You could also feed them de-husked peas. Most goldies love them - except mine
How are your water parameters? Ammonie, Nitrates, nitrites and pH? If your water quality is bad, then your fish won't be feeling well and really, who wants to eat when they are sick? Keep us posted...