refactor project structure

This commit is contained in:
hdt3213
2021-05-02 14:54:42 +08:00
parent bb9c140653
commit f29298cc68
78 changed files with 140 additions and 140 deletions

28
datastruct/utils/utils.go Normal file
View File

@@ -0,0 +1,28 @@
package utils
func Equals(a interface{}, b interface{}) bool {
sliceA, okA := a.([]byte)
sliceB, okB := b.([]byte)
if okA && okB {
return BytesEquals(sliceA, sliceB)
}
return a == b
}
func BytesEquals(a []byte, b []byte) bool {
if (a == nil && b != nil) || (a != nil && b == nil) {
return false
}
if len(a) != len(b) {
return false
}
size := len(a)
for i := 0; i < size; i++ {
av := a[i]
bv := b[i]
if av != bv {
return false
}
}
return true
}