From 8b9720b70a3cac6be169535395ee8d70d340e8a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Sat, 14 Sep 2024 15:10:14 -0400 Subject: [PATCH] correct Pull method to break out of inner loop if a match is found let's maybe not stop pulling elements after only the first one has been processed? --- document.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/document.go b/document.go index 3c0e6e9..587129e 100644 --- a/document.go +++ b/document.go @@ -172,12 +172,12 @@ func (d *Document) Pull(field string, a ...any) error { if fv.Kind() != reflect.Slice { return ErrNotASlice } -outer: for _, b := range a { + inner: for i := 0; i < fv.Len(); i++ { if reflect.DeepEqual(b, fv.Index(i).Interface()) { fv.Set(pull(fv, i, fv.Index(i).Type())) - break outer + break inner } } }