By letting him out when he barks your playing into it. He has you trained lol. Mine do too on somethings. One great thing I found for my Mum's goldens incessant barking is to fill a can with a handful of pennies, close it up.

Whenever Dougal barks give the can one firm shake. It'll catch his attention and stop the behavior. When he's quiet praise and reward him. It takes a little leg work initially but a few sleepless mornings is worth a life time of companionship.