Is 20 gallons good enough for two goldfish?
It’s certainly not enough for common goldfish and other slim-bodied goldfish (e.g. shubunkins and ryukins). Common Goldfish can grow up to 8 inches and above and need room to swim. This is a typical slim-bodied goldfish
At the bare minimum, you need 40 gallons for one goldfish and 10 gallons for additional according to top online sources (like aquariumtidings, fishlore etc). So if you have two slim-bodied goldfish, you need at least 50 gallons.
However, if you have fancy goldfish:
you can use a slightly smaller tank (20 gallons for one fish, then 10 gallons for each additional fish).
You’ll probably be OK with two small fancies in a 20 gallon, but you’ll have to do water changes more frequently, and they will not grow as large as they would in a larger tank