Skip to content

How to Generate a UUID V4 in Golang

Google has a package to generate a UUID compatible with RFC 4122 and DCE 1.1.

Add it to your project:

go get

Generating UUIDs:

package main

import (


func main() {
	myUUID := uuid.New()


Leave a Reply

Your email address will not be published. Required fields are marked *