Okay, folks, let’s dive into my little adventure with “glock the destroyer”.

It all started when I stumbled upon this tool. I was messing around, trying to, you know, optimize some stuff, and I needed a way to visualize goroutine blocking. That’s where glock came in.
Getting Started
First things first, I had to grab the thing. I used the good old go get
command. It was something like:
go get */your/path/to/glock
(just an example of usage).
I ran that, and boom, glock was on my machine. I didn’t put the exact URL, so you need to fill it in yourself. Easy peasy.
Diving In
Next, I had this Go program that was acting up. It was slow, and I suspected some goroutines were getting stuck. I wanted to see what was going on under the hood.
So, I integrated glock. This part was a bit tricky. I basically imported its package. I think add code like import "*/your/path/to/glock"
at top of *,you can find real URL yourself.
- and then you can call function. I remembered I have tested it, so I put some code around the parts of my code that I thought were causing problems.
I ran my program with glock enabled, and it started spitting out data. It was a lot of information, but it gave me a snapshot of what each goroutine was doing, whether it was running, waiting, or blocked.
Figuring It Out
The real magic happened when I started analyzing the output.I opened the generated file in my browser,and…bam! I saw these colorful graphs showing the goroutine activity over time. It was like having X-ray vision into my program!

I could see which goroutines were hogging resources, which ones were waiting on locks, and how long they were waiting. It was all laid out in front of me.
The “Aha!” Moment
After staring at the graphs for a while, I spotted it! There was this one goroutine that kept getting blocked on a mutex. It turned out I had a silly mistake in my code where I forgot to unlock it properly. Classic me!
Fixing the Mess
With the problem identified, fixing it was a breeze. I just went back to my code, added the missing Unlock()
call, and re-ran the program.
Victory!
I ran glock again, generated a new report, and…the blocking was gone! The graphs looked much smoother, and my program was running way faster. I felt like a superhero who just saved the day (or at least, saved my program from being a slowpoke).
I am happy with this, so I record it and share to all of you!
So, that’s my story with glock the destroyer. It’s a pretty handy tool when you need to dig into the guts of your Go programs and figure out why they’re not behaving. Just remember to use it wisely, and you’ll be debugging like a pro in no time!