Both the 'leaves' which are peeled and grated and are fried (I love it with eggs) and the fruit are edible, so they should be fine for goats. A little bit to try wouldn't hurt anything, make sure you take it out way before it gets moldy if they don't like it.
Funny story, I sold this Lamancha doe to a gal in New Mexico, I was heading the CA to visit family so I took her to them on the way out. She was my daughters goat and I was never very fond of her...she stepped out of the trailer, and while we were talking to the new owners she went over and put her nose in a cactus....welcome to New Mexico....she had to be put up on the milkstand and get the barbs removed from her nose

Vicki