1
0
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:
Simon Ernst
2019-10-17 13:30:05 +02:00
committed by Alexander Medvednikov
parent 4932a32d91
commit 270934441c
8 changed files with 11 additions and 14 deletions

View File

@@ -194,7 +194,7 @@ fn (ctx mut Context) parse_form(s string) {
}
fn (ctx mut Context) scan_static_directory(directory_path, mount_path string) {
files := os.ls(directory_path)
files := os.ls(directory_path) or { panic(err) }
if files.len > 0 {
for file in files {
mut ext := ''