3 ms·
how does the scoping works? From the homepage: import os text := os.read_file('app.log') or { eprintln('failed to read the file: ${err}')
by avinassh 4y ago
how does the scoping works? From the homepage:
import os
text := os.read_file('app.log') or {
eprintln('failed to read the file: ${err}')
return
}
lines := text.split_into_lines()
for line in lines {
if line.starts_with('DEBUG:') {
println(line)
}
}
Is lines empty or program exited after the error at `app.log`
- amedvednikov 4y agoIf there's an error at reading app.log, the error is printed, and the function is returned. Code after that won't run at all.