The tooltip about Goblin's says
These pesky little creaturews only have eyes for one thing: LOOT! They are faster than a Spring Trap, and their hunger for resouces is limitless.
Whenever I use Goblin's to attack they only attack resources and before they even get the chance to attack something else they are dead.
So what do Goblins attack something when all resources are down?
And if all resources are surrounded by walls do the goblin's attack the walls to get to the resources?