UUID
+ Added a lib for generating UUIDs + Added a tool function for getting random UUIDs
This commit is contained in:
parent
1f82828c82
commit
da6c7b53c7
@ -1,6 +1,7 @@
|
|||||||
package Tools
|
package Tools
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/twinj/uuid"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -8,3 +9,9 @@ func RandomInteger(max int) (rnd int) {
|
|||||||
rnd = rand.Intn(max)
|
rnd = rand.Intn(max)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func RandomGUID() (guidString string) {
|
||||||
|
guidString = uuid.NewV4().String()
|
||||||
|
guidString = guidString[1 : len(guidString)-1]
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user