mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-05 05:18:52 +08:00
20 lines
316 B
Go
20 lines
316 B
Go
|
package common
|
||
|
|
||
|
import "reflect"
|
||
|
|
||
|
type ByteSlice []byte
|
||
|
|
||
|
func (s ByteSlice) Clone() ByteSlice {
|
||
|
clone := make(ByteSlice, len(s))
|
||
|
copy(clone, s)
|
||
|
return clone
|
||
|
}
|
||
|
|
||
|
func (s ByteSlice) Equal(other ByteSlice) bool {
|
||
|
return reflect.DeepEqual(s, other)
|
||
|
}
|
||
|
|
||
|
func CloneByteSlice(s ByteSlice) ByteSlice {
|
||
|
return s.Clone()
|
||
|
}
|