Paul Goldschmidt hit a three-run, opposite-field home run with two outs in the eighth inning, and the Arizona Diamondbacks beat the San Francisco Giants 3-1 on Friday night.