From 88fed5bda2d03c97f9dbd0d71909ec7a09a850c2 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 b74fc54f41..e90f1073c7 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) } }