Skip to content

Commit

Permalink
fix example in README so it compiles
Browse files Browse the repository at this point in the history
`uuid.NewV4()` only returns a UUID, not a UUID + error which `Must` expects
  • Loading branch information
mattfenwick committed Aug 6, 2020
1 parent b2ce238 commit dc16453
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions README.md
Expand Up @@ -38,15 +38,11 @@ import (
func main() {
// Creating UUID Version 4
// panic on error
u1 := uuid.Must(uuid.NewV4())
u1 := uuid.NewV4()
fmt.Printf("UUIDv4: %s\n", u1)

// or error handling
u2, err := uuid.NewV4()
if err != nil {
fmt.Printf("Something went wrong: %s", err)
return
}
u2 := uuid.NewV4()
fmt.Printf("UUIDv4: %s\n", u2)

// Parsing UUID from string input
Expand Down

0 comments on commit dc16453

Please sign in to comment.