In code
Generate a UUID in Go
The google/uuid module is the de-facto standard.
Go example
Go
import "github.com/google/uuid"
id := uuid.New().String()
No install? Use the tool or API
Here's a fresh version 4 UUID generated right now — copy it, or call the API from any language.
313db764-c3ec-45fa-8028-da7d4c69e2f8
curl https://getuuid.sh/api/uuid