I wish there was better news to offer you for your fish, but unless you can move it to a larger tank, I can't see much hope of survival. 2 gallons is just too small to try to keep goldfish in long term. Waste levels build up too quick with goldfish (they're one of the dirtiest fish there is) and they consume more oxygen than the average freshwater fish.
Your problem is quite obvious to me, even without the test results. Your tank is too polluted, and the water quality is poisoning the fish. This happens when a fish is put into a tank thats too small or not enough maintenance is being done (water changes, gravel vacs, etc), also with overfeeding or feeding the wrong foods that don't get eaten fast enough.
For future reference, if you decide to try goldfish again...
Fancy goldfish grow to 6 - 8 inches, comets to 14 inches, and koi are not meant for an aquarium of any size, they need ponds because they average 2 - 3 ft full grown. Goldfish grow amazingly fast when they're healthy, so you always want to figure out how big a fish will get before deciding on the size tank to put it in. Fancy goldfish need a minimum of 90 gallons for just 1 - 2 of them, and they can go from 1 -2 inches all the way to 4 - 5 inches within the first yr or 2. If they don't grow fast, then I have to ask what is wrong, because that's the first sign of an unhealthy goldfish.
Fancy goldfish need to eat food that sinks, there is a specific goldfish pellet food designed to sink for them. Fancy goldfish should not feed at the surface because they gulp air, which causes severe swim bladder issues. Comet goldfish (like feeder goldfish) can feed on flake food until they are too large to gain any nutrition from it. Goldfish are heavy vegitarians, they need plant matter in their diet. Goldfish pellets are designed to provide a balanced amount for a regular diet.
Goldfish are cold water fish, needing temps from 65 - 68 degrees. The warmer the water the less oxygen in it, so most people choose to run extra filtration and air stones to help with more circulation and more oxygen in the water.
If you can increase the size of the tank before you start again, take things slow, let the tank run about a wk before adding the fish... you'd stand a good chance of keeping your fish healthy. Also, remember the bigger the tank the easier the maintenance. If you choose to go with the bare minimum in size for the fish you keep, expect to do water changes at least twice/wk if not more by the time you're done. When doing water changes, don't change filter media at the same time, as this tends to deplete the population of beneficial bacteria in the tank and can cause the tank to go thru a mini cycle. If this happens, the water conditions become toxic for the fish until it stabalizes.
And, when working with any aquarium, it's a good idea to have test kits for ammonia, nitrite, nitrate, and pH on hand. Typically when a fish gets sick this is the first place to find answers, and if fish need medicating, the water quality must first be checked to ensure it is safe to add the medicine. Any ammonia or nitrite and nitrate over 40 can turn many meds toxic instantly.
I know this probably isn't what you were expecting to hear, but we are here to help and being honest is the only way to do that. There simply is no way to keep goldfish in a small tank, especially not 2 gallons. If you're unable to get a larger tank, please choose fish that stay small and can handle that size of a tank. If you need suggestions, let us know, we can provide you with a list of options.