Can Good Deeds Erased?
Telling your sin in public may encourage other do sin so we should avoid doing so. It also shows that you have no fear of Allah which may considered arrogance.