Skip to content

Commit

Permalink
GODRIVER-1979 Use array.Values instead of array.Elements (#644)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjirewis authored Apr 23, 2021
1 parent 0a63b01 commit 88fed5b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions x/mongo/driver/topology/sdam_spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,12 @@ func getError(rdr bsoncore.Document) error {
}
case "errorLabels":
if arr, okay := elem.Value().ArrayOK(); okay {
elems, err := arr.Elements()
vals, err := arr.Values()
if err != nil {
continue
}
for _, elem := range elems {
if str, ok := elem.Value().StringValueOK(); ok {
for _, val := range vals {
if str, ok := val.StringValueOK(); ok {
labels = append(labels, str)
}
}
Expand Down Expand Up @@ -404,12 +404,12 @@ func getError(rdr bsoncore.Document) error {
copy(wcError.WriteConcernError.Details, info)
}
if errLabels, exists := doc.Lookup("errorLabels").ArrayOK(); exists {
elems, err := errLabels.Elements()
vals, err := errLabels.Values()
if err != nil {
continue
}
for _, elem := range elems {
if str, ok := elem.Value().StringValueOK(); ok {
for _, val := range vals {
if str, ok := val.StringValueOK(); ok {
labels = append(labels, str)
}
}
Expand Down

0 comments on commit 88fed5b

Please sign in to comment.