copy langext & termext from ffsclient
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package dataext
|
||||
|
||||
import (
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||
"math/rand"
|
||||
"strconv"
|
||||
"testing"
|
||||
@@ -251,18 +251,21 @@ func randomKey() string {
|
||||
}
|
||||
|
||||
func randomVal() LRUData {
|
||||
v := primitive.NewObjectID()
|
||||
v, err := langext.NewHexUUID()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return &v
|
||||
}
|
||||
|
||||
func eq(a LRUData, b LRUData) bool {
|
||||
v1, ok1 := a.(*primitive.ObjectID)
|
||||
v2, ok2 := b.(*primitive.ObjectID)
|
||||
v1, ok1 := a.(*string)
|
||||
v2, ok2 := b.(*string)
|
||||
if ok1 && ok2 {
|
||||
if v1 == nil || v2 == nil {
|
||||
return false
|
||||
}
|
||||
return v1.Hex() == v2.Hex()
|
||||
return v1 == v2
|
||||
}
|
||||
|
||||
return false
|
||||
|
Reference in New Issue
Block a user