Hi BY:

Brewer cites it as a euphemism for 'God-damned' and includes the following [undated] verse:

But when that choir got up to sing,
I couldn't catch a word;
They sang the most doggonest thing
A body ever heard!
[Will Carleton: Farm ballad]