If you need to get that close for a firearm to do it's job, you have the wrong firearm. A knife would work just as well.
A gun needs to keep the bad guys beyond arm's length. If it needs to be closer than ten feet to work, a perp with a knife or club will kill you.