v2 / vlib / v / gen / c / testdata / waiter_fns_gen_nix.vv
34 lines · 27 sloc · 398 bytes · b5f022d8045a4e8673950878e08b024c2b8642cc
Raw
1module main
2
3fn rsync(a string, b string) IError {
4 return none
5}
6
7fn main() {
8 options := {
9 'a': 'b'
10 'b': 'b'
11 'c': 'b'
12 'd': 'b'
13 }
14
15 mut eflag := false
16 mut threads := []thread IError{}
17
18 for srv, port in options {
19 threads << go rsync(srv, port)
20 }
21
22 awt := threads.wait()
23
24 for e in awt {
25 if e.str() != 'none' {
26 eflag = true
27 eprintln(e.str())
28 }
29 }
30
31 if eflag {
32 exit(1)
33 }
34}
35