First of all I would like to credit FerFal and his blog Surviving in Argentina. I totally stole this video from his blog. I am doing so because I want the dozen people who read my blog and don't read his bigger, better blog to see this. Also it leads into something I have been meaning to write about. Anyway first watch the video.
The lessons which FerFal notes are meaningful and I do not intend to unnecessarily rehash them. Here are my additional thoughts.
1. Unfortunately sometimes bad people are big, strong and skilled at fighting. A relatively large (or I guess larger than you) Goblin with even a modest background in combatives, who has been in and out of the correctional system and generally lives a rough violent life is really not someone you want to fight. They know what they are doing and are almost surely used to taking some punishment. Unlike some kid who tinkers in a moderately effective martial art they will almost surely not reconsider their intentions with a broken nose or a loosen a tooth. You will likely have to physically incapacitate this sort of person to stop them. I'm talking beating them unconscious, choking them out, crippling or killing them.
2. As FerFal noted semi automatic handguns tend to jam a lot at contact range. I would guess the primary causes are clothing or whatever getting snagged up in the struggle when the slide moves and limp wristing due to firing quickly from awkward positions. Practice clearing your weapon quickly under pressure. TAP the magazine, RACK the slide, BANG (if applicable). It is not going to clear every single failure but will clear most and can be done without breaking eye contact with your opponent while moving backwards to create space. Practice and you can do it very fast.
As seen when the Goblin picks up the still jammed gun in close quarters you would do well to just assume all battlefield pickups of semi automatic pistols are jammed and immediately TAP, RACK before looking to BANG.
3. Mace doesn't stop people. Particularly people who are used to taking punishment and potentially have even been maced before. Those huge cans that shoot the big stream are probably better than the little convenient to carry cans but still don't expect the result to be like a home run swing with a baseball bat to the face. Use mace to create space and time to get the heck out of there and or employ a better weapon. Expecting more than that is probably asking for trouble.
The main point I want to talk about is that different types of fights (somebody smart once broke fights down into 4 ranges, projectile, kicking, punching, dirty boxing (elbows, knees, short punches, throws, etc,) and grappling) are not discrete events that happen in isolation. Some firearms schools like to make you think that you can become so aware and skilled because of their amazing training that there will always be time to employ precision pistol fire from a safe distance. That is a bunch of crap.
It is egotistical and stupid and dangerous. Part of the reason is that these schools like to present themselves as being able to solve all your problems in a weekend. The concept of shooting someone can be sanitized and packaged. The reality of hand to hand is up close, personal and nasty. It requires physical conditioning which doesn't fit well with a "we can magically solve all your problems for some money over a long weekend" package. Also it takes a long time to become proficient at. You're talking about months and years not hours or days.
Even if you have a gun and know how to use it if somebody gets near or into kicking or punching range you are in a hand to hand fight. A gun is not a magical cure all. As FerFal noted someone with a bit of specific training can often stop that pistol from coming into the equation at all. I remember a disturbingly accurate saying "what is the first thing somebody does after being shot with a pistol? continue whatever they were doing before". Unless you hit someone in the brain or spine (imagine a T with the horizontal part between the eyes and the long vertical part extending down the spine) they will almost surely not be stopped in their tracks. Remember your goal is to STOP THE THREAT.
There are a lot of shots that will kill someone but that doesn't matter. If somebody cuts your head off with a piece of junk gas station knife then dies later from injuries you inflicted as far as I am concerned you lost. For example a shot through the liver or lung is, without prompt surgical intervention, almost surely lethal. However before the goblin loses enough blood or whatever to pass out they could potentially kill you. Conversely if you accidentally shoot someone low and to the outside and shatter their hip (depending on if you hit the artery, how bones shatter, etc) they will probably live but aren't going to keep coming at you. Thus you successfully managed to STOP THE THREAT. Shoot until you run out of ammo, can safely disengage or you STOP THE THREAT.
You've got to learn how to fight hand to hand. There just isn't a substitute for it. At a minimum you need to be able to get somebody off you and create enough space to break contact or employ a handgun. The cops use of his weak hand to create and maintain space was pretty effective in the video.
If somebody grabs you in a crowd and you are struggling then get them off you comes you you've gone from a standing grappling to dirty boxing or striking range. If they pull out a knife you are in a knife fight. A lot of the fundamentals do not change. Stuff like sound footing and being in a good athletic position translates through all ranges and situations.
There are all kinds of implied tasks here. Weapons training, firearm retention, combatives, knife and counter knife stuff come to mind. You could probably spend your whole life trying and not master these things. Don't worry about obscure fancy stuff or lots of ways to do things. Instead of trying to learn a dozen ways to deal with someone rushing you or grabbing you, or whatever it's probably better to be well practiced and drilled in two of them. It's blocking and tackling not quarter back sneeks. Gabe Suarez writes about this topic here.
Think about this stuff. How would you fare in a similar situation? Maybe you're a hulk of a fellow who wrestled through college or have been doing Judo since childhood, maybe you divide your spare time between power lifting and cage fighting and are generally a bad dude to mess with. However if that isn't the case you would be well advised to do something to better your situation. This is a great example of a case where anything helps. Take a self defense class. Learn about weapons retention by taking a course or working with a knowledgeable friend or acquaintance. Work on drawing and presenting a weapon while moving backwards. Practice clearing jams by feel without looking. Conduct low/ moderate intensity force on force drills to work through scenarios which trouble you. Just do something to better your situation.