Hi Mike,
I'm sorry to hear your goldfish isn't doing well.

Goldfish are wonderful fish to keep. They have such wonderful personalities, filled with charisma. If cared for properly, they will being their owners decades of joy.
Common goldfish originate from Prussian carp. They haven't strayed much from their carp ancestors, besides the color difference. At three years if age, a common goldfish should be close to 12 inches in body length, topping at 14 inches at 5 years. The fact that your goldfish is so small is quite concerning.
When kept in a small tank for long periods of time, the hormone that accounts for the fish's growth ceases to function. It automatically knows that the fish will not be able to grow at a proper pace. A large fish in a small pond will run out of food quicker than a small fish in a small pond. However, the growth hormone only accounts for the growth of the external portion and the skeleton of the fish. The internal organs are programmed to grow at a certain pace through the fish life, and there's next to nothing that will cause them to stray off this path.
The lack of growth of the outer part of the body is what we refer to as stunting. As stunting progresses, the internal organs will eventually start to press on each other, causing immense damage. They will put pressure on the eyes, swim bladder and stomach as they grow larger than the body can support. If confined to a small tank for too long, it will lead to a slow, painful and premature death.
A fish that can easily reach 14 inches in length should be kept in a tank no less than 75 gallons. A 10 gallon tank is incredibly small, and I can't see him surviving much longer in there.
A small tank also opens the door for toxin spikes. Because or their ineffective digestive systems, goldfish are known to produce a massive amount of waste. Every time a fish exhales or produces waste, they excrete a toxin called ammonia. Ammonia will be highly concentrated in such a small volume of water. Ammonia, even in small quantities is lethal to fish. It burns the skin and tissue, leaving it open to infection.
The ulcer that you are seeing is almost certainly an effect of poor water quality. At this point, medications will have no effect on the damaged tissue. The absolute best thing for your fish is a large tank with clean water.
Because aquariums can be very expensive, they usually aren't the best choice for most fishkeepers. Instead, you should defiantly consider transferring your goldie into a large, plastic storage container. They are fairly inexpensive online or at second hand shops, and can be placed almost anywhere. Flexible plastic allows the storage container to be placed directly on the ground without a heavy stand. And, they allow you to appreciate the fish from a whole new angle!
After transferring the fish to its new environment, daily water changes are absolutely a must. Goldfish LOVE water changes, and the clean environment will help aid in his healing. I suspect you will start to see noticeable improvement quickly, if you are willing to make the necessary changes.
Please keep us updated on how he is doing, and don't hesitate to ask any additional questions.
