Mine did the same thing, intermittently at first while the brake lights were still working. Replaced the switch, all is good. It's under $25, easy fix. Part number in the pic below. I got it from McGeorge, which I have always had a good experience with.
Sent from my SM-G986U using Tapatalk