mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: make ls() return an optional
This commit is contained in:

committed by
Alexander Medvednikov

parent
4932a32d91
commit
270934441c
@ -499,7 +499,7 @@ pub fn (v &V) v_files_from_dir(dir string) []string {
|
||||
} else if !os.dir_exists(dir) {
|
||||
verror("$dir isn't a directory")
|
||||
}
|
||||
mut files := os.ls(dir)
|
||||
mut files := os.ls(dir) or { panic(err) }
|
||||
if v.pref.is_verbose {
|
||||
println('v_files_from_dir ("$dir")')
|
||||
}
|
||||
|
Reference in New Issue
Block a user