a = "ABC", b = "123"
dict(zip(a, b))
# {"A": "1", "B": "2", "C": "3"}
zip() returns an iterator of tupes where the i-th tuple contains the i-th element from each of the argument sequences or iterators.
dict() constructor builds dictionaries directly from sequences of key-value pairs.
type Result struct {
Item item
Error error
}ch := make(chan Result)var wg sync.WaitGroupfor _, i:= range items { go func(i Item) {
defer wg.Done()
res, err := processItem(i)
if err != nil {
ch <- Result{Item: i, Error: err}
return
}…