milvus/pkg/common/byte_slice.go
jaime c9d0c157ec
Move some modules from internal to public package (#22572)
Signed-off-by: jaime <yun.zhang@zilliz.com>
2023-04-06 19:14:32 +08:00

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()
}