mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 11:59:00 +08:00
Fix golint warnings for proxy (#11894)
Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
This commit is contained in:
parent
e62e7bb801
commit
33bfd96d9f
@ -1952,7 +1952,7 @@ func (node *Proxy) CalcDistance(ctx context.Context, request *milvuspb.CalcDista
|
||||
}
|
||||
|
||||
if retrievedIds == nil || retrievedVectors == nil {
|
||||
return nil, errors.New("Failed to fetch vectors")
|
||||
return nil, errors.New("failed to fetch vectors")
|
||||
}
|
||||
|
||||
dict := make(map[int64]int)
|
||||
@ -1969,7 +1969,7 @@ func (node *Proxy) CalcDistance(ctx context.Context, request *milvuspb.CalcDista
|
||||
index, ok := dict[id]
|
||||
if !ok {
|
||||
log.Error("id not found in CalcDistance", zap.Int64("id", id))
|
||||
return nil, errors.New("Failed to fetch vectors by id: " + fmt.Sprintln(id))
|
||||
return nil, errors.New("failed to fetch vectors by id: " + fmt.Sprintln(id))
|
||||
}
|
||||
result = append(result, floatArr[int64(index)*element:int64(index+1)*element]...)
|
||||
}
|
||||
@ -1996,7 +1996,7 @@ func (node *Proxy) CalcDistance(ctx context.Context, request *milvuspb.CalcDista
|
||||
index, ok := dict[id]
|
||||
if !ok {
|
||||
log.Error("id not found in CalcDistance", zap.Int64("id", id))
|
||||
return nil, errors.New("Failed to fetch vectors by id: " + fmt.Sprintln(id))
|
||||
return nil, errors.New("failed to fetch vectors by id: " + fmt.Sprintln(id))
|
||||
}
|
||||
result = append(result, binaryArr[int64(index)*element:int64(index+1)*element]...)
|
||||
}
|
||||
@ -2009,7 +2009,7 @@ func (node *Proxy) CalcDistance(ctx context.Context, request *milvuspb.CalcDista
|
||||
}, nil
|
||||
}
|
||||
|
||||
return nil, errors.New("Failed to fetch vectors")
|
||||
return nil, errors.New("failed to fetch vectors")
|
||||
}
|
||||
|
||||
log.Debug("grpc calcDistance begin")
|
||||
@ -2154,9 +2154,9 @@ func (node *Proxy) CalcDistance(ctx context.Context, request *milvuspb.CalcDista
|
||||
}
|
||||
}
|
||||
|
||||
err = errors.New("Unexpected error")
|
||||
err = errors.New("unexpected error")
|
||||
if (vectorsLeft.GetBinaryVector() != nil && vectorsRight.GetFloatVector() != nil) || (vectorsLeft.GetFloatVector() != nil && vectorsRight.GetBinaryVector() != nil) {
|
||||
err = errors.New("Cannot calculate distance between binary vectors and float vectors")
|
||||
err = errors.New("cannot calculate distance between binary vectors and float vectors")
|
||||
}
|
||||
|
||||
return &milvuspb.CalcDistanceResults{
|
||||
|
@ -391,7 +391,7 @@ func (sa *segIDAssigner) GetSegmentID(collID UniqueID, partitionID UniqueID, cha
|
||||
}
|
||||
sa.Reqs <- req
|
||||
if err := req.Wait(); err != nil {
|
||||
return nil, fmt.Errorf("GetSegmentID failed: %s", err)
|
||||
return nil, fmt.Errorf("getSegmentID failed: %s", err)
|
||||
}
|
||||
|
||||
return req.segInfo, nil
|
||||
|
@ -251,7 +251,7 @@ func (mockD *mockDataCoord5) AssignSegmentID(ctx context.Context, req *datapb.As
|
||||
ErrorCode: commonpb.ErrorCode_UnexpectedError,
|
||||
Reason: "Just For Test",
|
||||
},
|
||||
}, fmt.Errorf("Just for test")
|
||||
}, fmt.Errorf("just for test")
|
||||
}
|
||||
|
||||
func TestSegmentAllocator5(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user