9951 explained code solutions for 126 technologies

golangHow to generate UUID and convert it to string

This uses uuid module that should be installed by go get github.com/google/uuid command:

package main

import "fmt"
import "github.com/google/uuid"

func main() {
  string_uuid = (uuid.New()).String()
}ctrl + c

module to work with uuid


init new UUID value


converts generated UUID to string