Actually I don't believe it comes from gold mining - though the meaning is similar. If you google "flash in the pan origin" you'll see it comes from a type of gun used a couple of centuries ago. The gunpowder in one part (the pan) exploded, but the gunpowder that needed to explode to shoot the gun did not.
So, a flash in the pan is an early sign that something will happen that is not followed by it actually happening.