Home »
Code Examples »
Golang Code Examples
Golang - Generate UUID (Universally Unique Identifier) Code Example
The code for Generate UUID (Universally Unique Identifier)
package main
import (
"fmt"
"log"
"os/exec"
)
func main() {
New_UUID, error := exec.Command("uuidgen").Output()
if error != nil {
log.Fatal(error)
}
fmt.Println("Generated New UUID:")
fmt.Printf("%s", New_UUID)
}
Code by IncludeHelp,
on February 28, 2023 15:48