Yes, I think Nicky could possibly be correct, this certainly sounds like a swim bladder issue. Sometimes goldfish enthusiasts feed their fish a couple of peas. Also, if the fish is still eating, try stopping food for a few days and see if any improvement occurs. A more drastic treatment for treating swim bladder disorders is to actually expel some air from the swim bladder. This does however involves sticking a pin into the fish to release the air. I'm not going to suggest you do this though, if you know somebody who has experience they could possibly try this at a last resort.
Apart from that, I'm not aware of the many successful treatments for serious swim bladder complaints. Sometimes fish have these problems on the go away as quickly as they came so let's just hope your fish gets over this.