Go 1.27 Ships a Native UUID Package. Here's How To Use It!
Let's explore the new uuid package in Go 1.27! If you would like to see a quick summary of all the changes in Go 1.27, check out this video: https://youtu.be/RboN0J87NrA 📝 Description Master Go 1.27's new native `uuid` package. In this quick tutorial, we drop third-party dependencies and use the standard library to generate, parse, and derive UUIDs. We build a practical webhook deduplicator that recognizes retried deliveries by their content, so you can see exactly where UUIDs fit in a real service. Here's what you will learn: • Understand the generator functions: NewV4 (random), NewV7 (time-ordered), New (the "I don't care" default), plus the Nil and Max placeholder values. • Learn why a fixed namespace beats a random one, and how MustParse and Parse differ when turning strings into UUIDs. • Build a deterministic event ID by hashing a namespace and payload with SHA-256, so identical bytes always produce the same UUID on every server. • Create a concurrency-safe Dedup type with a mutex-guarded map that detects retried webhook deliveries. • See the full example in action: process new payments and skip duplicates, without any external library. ⏳ Timestamps: 00:00 - Introduction 00:22 - Use Case 13:27 - Testing 13:50 - Outro 👋 Hey there! If you are new to this channel: Hey 👋 my name is Flo and I am a professional software engineer with a passion for coding in Golang, TypeScript, JavaScript, and Rust. This channel is where I share that passion and dive into the exciting world of software engineering. 📨 Support and Connect! Become a member. https://www.youtube.com/@FloWoelki/membership Discord: https://discord.gg/TnA7drJ X / Twitter: https://x.com/FlorianWoelki LinkedIn: https://www.linkedin.com/in/florian-woelki/ GitHub: https://github.com/FlorianWoelki 📝 Copyright Notice The original Go Gopher was designed by Renée French (Source: https://go.dev/blog/gopher License details: https://creativecommons.org/licenses/by/4.0/). The gopher appearing in this video and thumbnail has been modified from the original design and is based on an illustration from Maria Letta's free-gophers-pack (Source: https://github.com/MariaLetta/free-gophers-pack License: CC0 1.0 Public Domain https://creativecommons.org/publicdomain/zero/1.0/). #go #go127 #uuid




Join the discussion
Sign in to join the discussion
Sign in