Skip to content

Commit 1363ce7

Browse files
committed
Update cognito fetch groups func
1 parent 7c4eece commit 1363ce7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

plugins/cognito/pkg/fetch/fetch.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,11 @@ func (f *Fetcher) fetchGroups() iter.Seq2[map[string]any, error] {
109109
return func(yield func(map[string]any, error) bool) {
110110
for _, group := range groups {
111111
groupBytes, err := json.Marshal(group)
112-
if err != nil {
113-
if !yield(nil, err) {
114-
return
115-
}
112+
if err != nil && !yield(nil, err) {
113+
return
116114
}
117115

118-
var obj map[string]interface{}
116+
var obj map[string]any
119117
err = json.Unmarshal(groupBytes, &obj)
120118

121119
if !(yield(obj, err)) {

0 commit comments

Comments
 (0)