Go Cheatsheet - Generate UUIDv4 String
Use 3rd-party package to generate uuidv4 string:
Step 1
Install package:
go get github.com/google/uuid
Step 2
Call function:
func main() {
uuidStr := uuid.NewString()
fmt.Println(uuidStr)
}
Use 3rd-party package to generate uuidv4 string:
Install package:
go get github.com/google/uuid
Call function:
func main() {
uuidStr := uuid.NewString()
fmt.Println(uuidStr)
}