With plants its a thing - you have to find the ones that goldfish do not like to eat, otherwise its a battle you can't win. You buy fish, fish will eat it, you buy new ones, fish will eat them again, etc.....

It also depends on the light you have for your tank. How big is the tank, and do you know how many wattage the light (if you have any) has?
Generally, some "goldfish hardy" plants are java moss and java fern, onion plant, some anubia. Mine leave the anacharis and cabomba alone as well, but not every goldie does that....