Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyang-hu committed Jun 11, 2024
1 parent b0455bf commit 47abc06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mongo/integration/cmd_monitoring_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func compareValues(mt *mtest.T, key string, expected, actual bson.RawValue) erro
if typeVal, err := e.LookupErr("$$type"); err == nil {
// $$type represents a type assertion
// for example {field: {$$type: "binData"}} should assert that "field" is an element with a binary value
switch t := typeVal.Type; t {
switch typ := typeVal.Type; typ {
case bson.TypeString:
return checkValueType(mt, key, actual.Type, typeVal.StringValue())
case bson.TypeArray:
Expand All @@ -96,9 +96,9 @@ func compareValues(mt *mtest.T, key string, expected, actual bson.RawValue) erro
return nil
}
}
return fmt.Errorf("BSON type mismatch for key %s; expected %s, got %s", key, array.String(), actual)
return fmt.Errorf("BSON type mismatch for key %q; expected %s, got %q", key, array, actual.Type)
default:
return fmt.Errorf("unsupported $$type: %s", t.String())
return fmt.Errorf("unsupported $$type: %q", typ)
}
}

Expand Down

0 comments on commit 47abc06

Please sign in to comment.