-(느)ㄴ다는 것이

Intended to... but ended up..., By mistake

Explanation

This expression is used to indicate that the result stated in the following clause is not the result of the intention stated in the preceding clause. It is also used in the shortened form -(느)ㄴ다는 게. It only attaches to verbs.

Details

For this expression, the subjects of both the preceding and following clauses must be the same.

(제가) 구경만 한다는 것이 하나밖에 안 남았다고 하니까 친구가 또 사고 말았어요.