DEV Community

Cover image for A Tiny, Dependency-Free UUID Checker for Go!
Ashwin Gopalsamy
Ashwin Gopalsamy

Posted on • Edited on • Originally published at ashwingopalsamy.substack.com

1 1 1 1 1

A Tiny, Dependency-Free UUID Checker for Go!

As like few folks, at times, when I deal with UUIDs in Go, I rarely needed a big, feature-packed library - just a lean way to confirm something basic, like, “Yes, that string is definitely a UUID.” Sometimes, I’d also want to check if it was a UUIDv7 and maybe peek at its embedded ‘timestamp’.

Nothing major, just a quiet helper in the background.

And what?

That’s why I built uuidcheck. It’s not a complex stuff, just a handful of meaningful functions that stick to Go’s standard library. No external dependencies at all.

Only the baby steps?

I didn’t stop at making it small. I wrote clear Go-doc style documentation so you can read about each function right in pkg.go.dev; no guesswork needed. Every corner of the logic got a unit test, pushing coverage to 100%. It wasn’t hard, given the library’s size, but it’s nice to know everything’s solid. If a weird edge case comes up, I can trust the tests already have my back. Even if something slipped my mind, I would love your ‘good first contribution’ to the library.

Do you need to care?

To be honest, most projects don’t need a daily UUID validation routine or a quick timestamp extraction from UUIDv7 strings. But when you do, uuidcheck might save you from writing the same checks over and over. It’s small, neat, and does the job without weighing you down.

So, if you ever find yourself thinking, “I just need to confirm this is a real UUID, nothing else.” Remember github.com/ashwingopalsamy/uuidcheck.

It’s there to help, staying out of your way, and giving you that tiny bit of confidence where it matters.

Thanks for reading! May the code be with you :)

My Social Links: LinkedIn | GitHub | 𝕏 (formerly Twitter) | Substack | Dev.to

For more content, please consider subscribing. See ya!

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more