mirror of https://github.com/milvus-io/milvus.git
Fix golint error in proxy (#10620)
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>pull/10619/head
parent
1478b9298c
commit
bb08df28f3
|
@ -1141,7 +1141,7 @@ func (cct *createCollectionTask) PreExecute(ctx context.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if err := ValidateDuplicatedFieldName(cct.schema.Fields); err != nil {
|
||||
if err := validateDuplicatedFieldName(cct.schema.Fields); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -1004,7 +1004,7 @@ func TestCreateCollectionTask(t *testing.T) {
|
|||
err = task.PreExecute(ctx)
|
||||
assert.Error(t, err)
|
||||
|
||||
// ValidateDuplicatedFieldName
|
||||
// validateDuplicatedFieldName
|
||||
schema = proto.Clone(schemaBackup).(*schemapb.CollectionSchema)
|
||||
schema.Fields = append(schema.Fields, schema.Fields[0])
|
||||
duplicatedFieldsSchema, err := proto.Marshal(schema)
|
||||
|
|
|
@ -162,7 +162,7 @@ func validateVectorFieldMetricType(field *schemapb.FieldSchema) error {
|
|||
return errors.New("vector float without metric_type")
|
||||
}
|
||||
|
||||
func ValidateDuplicatedFieldName(fields []*schemapb.FieldSchema) error {
|
||||
func validateDuplicatedFieldName(fields []*schemapb.FieldSchema) error {
|
||||
names := make(map[string]bool)
|
||||
for _, field := range fields {
|
||||
_, ok := names[field.Name]
|
||||
|
|
|
@ -138,11 +138,11 @@ func TestValidateDuplicatedFieldName(t *testing.T) {
|
|||
{Name: "abc"},
|
||||
{Name: "def"},
|
||||
}
|
||||
assert.Nil(t, ValidateDuplicatedFieldName(fields))
|
||||
assert.Nil(t, validateDuplicatedFieldName(fields))
|
||||
fields = append(fields, &schemapb.FieldSchema{
|
||||
Name: "abc",
|
||||
})
|
||||
assert.NotNil(t, ValidateDuplicatedFieldName(fields))
|
||||
assert.NotNil(t, validateDuplicatedFieldName(fields))
|
||||
}
|
||||
|
||||
func TestValidatePrimaryKey(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue