are they fancy goldfish or common/comet goldfish? fancies are more prone to bouyancy issues, especially if fed floating type diets with no greens regularly. feeding cooked shelled peas at least a couple of times per week is a must for all goldfish IMO, but especially fancy goldfish. i also only feed sinking foods, i stick with saki hikari sinking mini pellets.
if it is floating with any portion of its body exposed to the air it will suffer with its skin drying out, and you really need to euthanise.
if you do decide to euthanise, do not flush the fish. either blunt trauma to the head, decapitate, or my preferred method is clove oil mixed into a small amount of tank water until a milky colour, added to a bowl with the fish and enough water to cover its body. it will put the fish to sleep, and then add more clove oil to stop the heart. its the kindest way IMO, very little stress, and if done a little at a time until it floats on its side or upside down then theres no reaction to the clove oil being added to the water. if you add too much at once they can stress a little but they quickly fall asleep either way.
10gallons per fish is for fancy type goldfish, fat bodies, twin tails. this is also 10g per fish after 20g for the 1st fish. so a pair would need 30g. for your 6 if fancy they would need a 70g tank, or at least double that if common streamlined single tailed types.
7 years isnt nearly half the life expectancy of a goldfish so hopefully it wont be something that cant be fixed.