From e963b88db159b76f257d73d73a4bb0b0bef83e4a Mon Sep 17 00:00:00 2001 From: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com> Date: Fri, 23 Apr 2021 13:47:36 -0400 Subject: [PATCH] GODRIVER-1979 Use array.Values instead of array.Elements (#644) --- x/mongo/driver/topology/sdam_spec_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/x/mongo/driver/topology/sdam_spec_test.go b/x/mongo/driver/topology/sdam_spec_test.go index b74fc54f41f..e90f1073c75 100644 --- a/x/mongo/driver/topology/sdam_spec_test.go +++ b/x/mongo/driver/topology/sdam_spec_test.go @@ -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) } } @@ -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) } }