vxx2 / vlib / v / checker / tests / map_result_callback_fn_err.vv
25 lines · 22 sloc · 453 bytes · 0c8ce3bcb9fd4a2e5bd5f991a5a07da976d780d7
Raw
1import os
2import cli
3import net.urllib
4
5pub fn sync() cli.Command {
6 return cli.Command{
7 name: 'sync'
8 description: 'sync local dens from remote'
9 execute: execsync
10 }
11}
12
13fn execsync(cmd cli.Command) ! {
14 dens := os.read_lines('/etc/fox/dens')!.map(urllib.parse(it)!)
15 mut threads := []thread !{}
16 for den in dens {
17 threads << spawn update(den)
18 }
19 threads.map(it.wait()!)
20}
21
22fn update(den urllib.URL) ! {
23 println(den.str())
24 return
25}
26