Invisible electric fences can work with some golden retrievers. However, they are not a good substitute for an owner's supervision. There are several reasons for that.
First of all, most invisible fences work because they detect a signal from a special collar on the golden retriever. If the collar falls off or the batteries in the collar die without the owner's knowledge then the golden retriever can easily escape.
Another problem is that some golden retrievers may see something outside the fence line that gets them overly excited, such as a small animal. The golden retriever might break through the invisible fence line when they are in an extremely excited state and then, after the feeling wears off, they might not want to come back because of the invisible fence.
Believe it or not, the most common problem with electric invisible fences is not trying to keep the individual golden retriever in. The biggest problem is actually trying to keep other things out. Since the invisible fences work based on an electric impulse from one particular golden retriever's collar, they do nothing to keep other neighborhood DOGS out of the yard. For that matter, they also don't prevent wildlife, such as raccoons or coyotes, from coming into your golden retriever's environment either.
Some places don't allow standard fences, such as wood or chain link. In those instances, an invisible fence may be the only alternative. If your golden retriever is going to be supervised in the yard then an invisible fence may be fine. However, there is no substitute for a standard fence when it comes to keeping other animals out. If you can have a standard fence then you should have one. That will protect not only your golden retriever, but also the rest of the family.