当前位置:   article > 正文

go随聊-uuid生成_go 生成uniqid

go 生成uniqid

本文介绍一个go 生成UUID的包

UUID package for Go language

This package provides pure Go implementation of Universally Unique Identifier (UUID). Supported both creation and parsing of UUIDs.

Installation

go get github.com/satori/go.uuid

Requirements

        UUID package tested against Go >= 1.6.

Example

  1. import (
  2. "fmt"
  3. "testing"
  4. "github.com/satori/go.uuid"
  5. )
  6. func TestUUIDBuild(t *testing.T) {
  7. u,err:=uuid.NewV4()
  8. if err!=nil {
  9. fmt.Println(err)
  10. }else{
  11. fmt.Println(u)
  12. }
  13. }
  14. ----------------------------------------
  15. 10b583d2-2ecc-4854-8a3d-270dbe6b5665

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Li_阴宅/article/detail/850905
推荐阅读
相关标签
  

闽ICP备14008679号