Is there a method to generate a UUID with go language

后端 未结 12 1737
温柔的废话
温柔的废话 2020-12-07 12:15

I have code that looks like this:

u := make([]byte, 16)
_, err := rand.Read(u)
if err != nil {
    return
}

u[8] = (u[8] | 0x80) & 0xBF // what does thi         


        
12条回答
  •  误落风尘
    2020-12-07 12:23

    This library is our standard for uuid generation and parsing:

    https://github.com/pborman/uuid

提交回复
热议问题