Skip to content

Commit

Permalink
Fix golint error in proxy (#10618)
Browse files Browse the repository at this point in the history
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
  • Loading branch information
czs007 authored Oct 25, 2021
1 parent cf574b3 commit 9458e04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/proxy/validate_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func validateDimension(dim int64, isBinary bool) error {
return nil
}

func ValidateVectorFieldMetricType(field *schemapb.FieldSchema) error {
func validateVectorFieldMetricType(field *schemapb.FieldSchema) error {
if (field.DataType != schemapb.DataType_FloatVector) && (field.DataType != schemapb.DataType_BinaryVector) {
return nil
}
Expand Down
8 changes: 4 additions & 4 deletions internal/proxy/validate_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,21 @@ func TestValidateVectorFieldMetricType(t *testing.T) {
TypeParams: nil,
IndexParams: nil,
}
assert.Nil(t, ValidateVectorFieldMetricType(field1))
assert.Nil(t, validateVectorFieldMetricType(field1))
field1.DataType = schemapb.DataType_FloatVector
assert.NotNil(t, ValidateVectorFieldMetricType(field1))
assert.NotNil(t, validateVectorFieldMetricType(field1))
field1.IndexParams = []*commonpb.KeyValuePair{
{
Key: "abcdefg",
Value: "",
},
}
assert.NotNil(t, ValidateVectorFieldMetricType(field1))
assert.NotNil(t, validateVectorFieldMetricType(field1))
field1.IndexParams = append(field1.IndexParams, &commonpb.KeyValuePair{
Key: "metric_type",
Value: "",
})
assert.Nil(t, ValidateVectorFieldMetricType(field1))
assert.Nil(t, validateVectorFieldMetricType(field1))
}

func TestValidateDuplicatedFieldName(t *testing.T) {
Expand Down

0 comments on commit 9458e04

Please sign in to comment.