This commit is contained in:
hdt3213
2021-05-12 00:27:29 +08:00
parent 55ada39252
commit 97d7b84276
58 changed files with 490 additions and 343 deletions

View File

@@ -1,5 +1,6 @@
package utils
// Equals check whether the given value is equal
func Equals(a interface{}, b interface{}) bool {
sliceA, okA := a.([]byte)
sliceB, okB := b.([]byte)
@@ -9,6 +10,7 @@ func Equals(a interface{}, b interface{}) bool {
return a == b
}
// BytesEquals check whether the given bytes is equal
func BytesEquals(a []byte, b []byte) bool {
if (a == nil && b != nil) || (a != nil && b == nil) {
return false