I've kept a few goldfish
varieties in 10 gallon tanks. 1 at a time mind you. IMO since the smaller the tank, the more trouble to keep healthy, I personally wouldn't do it again. goldfish
are very dirty, & my moor quickly outgrew the tank, constant issues with ammonia despite it having been fully cycled & constant water changes.
I've heard it said that you should give a goldfish (dirty fish) 3 gallons of water per inch of adult fish... So keep in mind the adult size of the fish if you decide to go ahead with it. A 3" sarasa comet for example looks like he's done growing, but the reality is he can grow to 14" give or take. (I have 1 in a 55 gallon though he does have some company, mind you.)
My sister recently set up her first 10 gallon & put a common pleco (also a dirty fish) in it along with a blue gourami. Personally, I feel bad for that pleco since he's gonna get big, far too big for that tank. (I think they grow to 12"-18".)
My current 10 gallon tank houses 1 male betta & 2 female dwarf gourami. They get along beautifully, swim together, etc. Water quality hasn't been an issue either.