Abu Huraira reported: The Messenger of Allah, peace and blessings be upon him, said, “Everyone from my nation will be forgiven except those who sin in public. Among them is a man who commits an evil deed in the night that Allah has hidden for him, then in the morning he says: O people, I have committed this sin! His Lord had hidden it during the night, but in the morning he reveals what Allah has hidden.”
Source: Ṣaḥīḥ al-Bukhārī 6069, Ṣaḥīḥ Muslim 2990