What selzer said.
The dog was outside, unsupervised, contained by nothing other than an electric fence, which was not clearly marked. When the officer passed the yard, the dog jumped off the porch and charged at the officer, barking. The officer actually stood his ground and told the dog to stop - which is the thing that most people are taught when being faced with an aggressively charging dog. Tell the dog STOP or GO HOME in an authoritative voice. He did exactly that. The dog kept charging, so he shot the dog.
This is 100% the family's fault. Even though they know that their dog barks at and charges passers-by, they leave the dog outside, unsupervised, contained only by an electric fence. At the time this happened, three of the family's boys were inside the house, nobody was outside watching the dog. I wonder how many times the dog has charged at someone? How many times he's gone through the fence? And I LOVE the excuse, "He's a Golden Retriever. He barks, but he's never bitten anyone." As if Goldens don't bite.