The "goldfish only grow to the size of their tank" rule really annoys me. It is partially correct: in a small space, ammonia builds up more quickly, so the goldfish suffer from cruelly stunted growth, whilst in a bigger space, the ammonia is more diluted so the goldfish have a chance to grow bigger. However, it isn't tank size that ultimately determines it - it's how much ammonia is in the water. It just so happens that smaller tanks get filthier more quickly.
An example: due to petshop misguidance (we've all been there...sigh) we started off with two goldies in a 10 litre (2.5 gallon tank). Both were comets. We upgraded them to a 15 litre (3 gallon) because they kept growing. Eventually, the three of them ended up in our current 23 gallon. Two died and my sister's youngest one was the only one remaining. Now, his growth is, sadly, irreversibly stunted and his lifespan shortened by our earlier treatment of him. :( After I researched on fish and found some things out, the tank has stayed a little cleaner due in part to my nagging, and he has still hit ten inches because the water is just about clean enough. If we had him in a pond from day one (he is moving to a pond when this flooding stops) he would probably be a good foot long by now.
But as you can see from my example (or ramble), it is water quality that determines size. If you kept the water in a one gallon bowl clean enough (very difficult), the goldfish would grow until his face and tail touched the edges of the bowl. Keep him in a 50 gallon tank with no filter that is never ever cleaned, and he won't grow big at all.