mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-28 22:45:26 +08:00
[skip ci]Improve error messages in convension (#10352)
Signed-off-by: Xiangyu Wang <xiangyu.wang@zilliz.com>
This commit is contained in:
parent
81743d9642
commit
bbd558f509
@ -37,7 +37,7 @@ func BytesToFloat32(bytes []byte) float32 {
|
||||
// BytesToInt64 converts a byte slice to uint64.
|
||||
func BytesToInt64(b []byte) (int64, error) {
|
||||
if len(b) != 8 {
|
||||
return 0, fmt.Errorf("invalid data, must 8 bytes, but %d", len(b))
|
||||
return 0, fmt.Errorf("Failed to convert []byte to int64: invalid data, must 8 bytes, but %d", len(b))
|
||||
}
|
||||
|
||||
return int64(binary.BigEndian.Uint64(b)), nil
|
||||
@ -53,7 +53,7 @@ func Int64ToBytes(v int64) []byte {
|
||||
// BytesToUint64 converts a byte slice to uint64.
|
||||
func BytesToUint64(b []byte) (uint64, error) {
|
||||
if len(b) != 8 {
|
||||
return 0, fmt.Errorf("invalid data, must 8 bytes, but %d", len(b))
|
||||
return 0, fmt.Errorf("Failed to convert []byte to uint64: invalid data, must 8 bytes, but %d", len(b))
|
||||
}
|
||||
|
||||
return binary.BigEndian.Uint64(b), nil
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user