A DM who metagames like that is a bad DM. Gobins can't know that if the barbarian can't see them for a round she will stop raging. Monsters should be blind to game mechanics.
Or the DM could narrate the goblins are terrified of the barbarian when they see the rage emerge (his anger, yelling, or steely-eyed cold-killer demeanor, etc.) and all hide to protect themselves (especially if he has been raging for a round or more and
already killed some of them).
Even if they do this, nothing stops the barbarian from attacking
anything around him (a tree, crushing a rock with a hammer, etc), cutting himself for 2 points of damage (reduced to 1 due to raging), etc. to keep the rage going.
So, as long as it fits the narrative of the encounter, the DM having all the goblins hide isn't a bad thing IMO. Just because you don't like how an encounter plays out, doesn't mean the DM is "bad" or "ignoble." After all, players use knowledge of mechanics
all the time to their advantage (oh, this creature is resistant to
that and you want to use silver or magic weapons against "this", etc.).