Skip to content

Commit 9d7defb

Browse files
authored
keep the order of error (#614)
1 parent fb44089 commit 9d7defb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

resource/cobalt/call.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ func call[T any](ctx context.Context, ps []plugins.Plugin, f func(plugins.Plugin
2929
}
3030
wg.Wait()
3131
ans := make(map[plugins.Plugin]T)
32-
results.Range(func(key, value any) bool {
32+
for _, p := range ps {
33+
value, _ := results.Load(p)
3334
switch vt := value.(type) {
3435
case error:
3536
combinedErr = errors.CombineErrors(combinedErr, vt)
3637
case T:
37-
ans[key.(plugins.Plugin)] = vt
38+
ans[p] = vt
3839
}
39-
return true
40-
})
40+
}
4141
return ans, combinedErr
4242
}

0 commit comments

Comments
 (0)