People who've cheated and are now ending the relationship anyway often wrestle with whether to disclose it. The argument for telling: your partner deserves accurate information to make sense of the ending, and to protect their own health and future decisions if relevant. Finding out later, especially from someone else, often does more damage to their ability to trust in future relationships than the original news would have.
The argument against blanket disclosure: confession can sometimes function more for the confessor's relief than the recipient's benefit — unloading guilt onto someone who now has to carry information they didn't ask for and can't do anything about, especially if the relationship is already ending regardless.
A reasonable middle ground: if you're ending the relationship anyway, you don't necessarily owe a detailed account, but withholding relevant facts — particularly anything with health implications — crosses from privacy into deception. If you're staying together, disclosure is much more clearly the right call, because a relationship that continues under false pretenses isn't really the relationship your partner thinks they're in.
There's no version of this that isn't painful. But the least defensible option is confessing purely to relieve your own conscience while dressing it up as being for your partner's benefit. Be honest with yourself about which one you're actually doing.