No. Fasting is required before receiving Communion, not before going to Mass. However you might consider fasting before Mass as a voluntary means of self-discipline and reparation for your sin. Also in some situations it might avoid scandalising others (who might wonder why you are eating just before going to Mass.)
And of course I hope you’re going to confess that sin ASAP so you can rejoin the Lord’s Table!
Personally I think that the one hour fast before Communion (in effect if you’ve got a 20-minute trip to the church, it is nothing more than “don’t pop food into your mouth just before you walk out the door”) is a bare legal minimum which we should go beyong if at all possible. If going to a morning Mass I don’t eat anything, except a cup of tea on getting up, from bedtime the previous night (or 3 hours before if going to an afternoon or evening Mass).