I think what a lot of people forget is that a goldfish is a type of CARP. You wouldn't keep a carp in a 5 gallon, so why a goldfish? They're large, messy fish that produce a LOT of waste, and they should be kept in groups being sociable fish. An ideal set-up is a MINIMUM 55 gallon, with a small amount of fish (4 or 5 tops), with regular water changes. This might seem sparse but unless you have a lot of time to maintain a smaller tank, this is the most manageable scenario.
As jo3olous has already pointed out, comets are actually quite a bit larger (potentially) than your average goldfish. With they're tails, they can grow up to 1 and a half feet. That is definately bigger than your average 5 gallon.
And when MissFishy says small living quarters stunts a fishes growth it's very true. I acquired a goldfish from someone a few years ago, they'd had it for a year in one of those tiny plastic "start-up" bowls. They'd got it the same day I got one of mine, as an LFS has set up a stall at a local school fair (but in a large plastic trough, not your average bags hanging on a rail). This goldfish when I was given it was about 4 inches long as opposed to mine being a good 8 inches, and it didn't grow any noticeable amount for a good two years after when it suddenly died.
As a goldfish keeper I sincerely hope you don't try this little "experiment" because it's never going to end nicely. If anything, goldfish can be harder to look after and maintain happily than a good proportion of your common tropical fish.
Oh and just a quick note, your goldfish will eat your ghost shrimp when it grows, simple as.