I think the point was don't bring a knife to a gunfight is just a cliche, not a hard fast rule, and may only apply if you know a gunfight is coming. But if you knew there would be a gunfight, who would actually choose to attend said gunfight? The cliche should be don't bring yourself or don't show up to a gunfight.
Nope. I see them everyday, most police, most security and bank officers, most people I see working at ranges armed, and most people I see at ranges shooting. All have guns and most are unsuspecting. It's their electronics today, taking their attention away from the world 10-15 seconds out of almost every minute to glance down and check their phone. Freaking Barney wearing horn shoes could sneak up on the majority of these folks and stab them in the back while they check their social media.
Regardless, unless you are highly skilled with a handgun, drawing and making shutdown immobilizing hits (brain, spinal cord) within a few seconds on a moving target, even an untrained attacker with a knife can hurt and possibly critically injure you very very easily. Without that level of training I would doubt you finish your draw stroke and are instantly fighting for your life in panic city. If you think otherwise, time to get more realistic handgun training. If you are that skilled, great, you shouldn't have been there in the first place.
Youtube videos to defend against it? I wouldn't let someone guard my empty beer cans in the recycling bin after watching a youtube video. Watch some knife attack videos where people with guns (sometime more than a few guns or people) were sliced up and/or killed because they didn't have the training and/or didn't follow it to just fire and kill the attacker as soon as the knife was presented.
Obviously anything said above reverse it just by having a loaded rifle or shotgun (00 Buck) in hand with mild training (like at home). Handguns are weak and inefficient weapons with their biggest strength concealment adding to reaction time.