Skip to content

Instantly share code, notes, and snippets.

@up1
Last active June 21, 2026 03:52
Show Gist options
  • Select an option

  • Save up1/19522893a1a0e71a3efc41c135e0754e to your computer and use it in GitHub Desktop.

Select an option

Save up1/19522893a1a0e71a3efc41c135e0754e to your computer and use it in GitHub Desktop.
UUID in go 1.27
$go install golang.org/dl/go1.27rc1@latest
$go1.27rc1 download
$go version
go version go1.27rc1 darwin/arm64
package main
import (
"fmt"
"uuid"
)
func main() {
// Generate a new UUID v7
id := uuid.NewV7()
fmt.Println(id)
fmt.Println(id.String())
// Parse a UUID string
_, err := uuid.Parse("550e8400-e29b-41d4-a716-446655440000")
if err != nil {
fmt.Println("invalid")
return
}
fmt.Println("valid")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment