1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

http: make download_file() return an optional

This commit is contained in:
Alexander Medvednikov
2020-11-24 18:07:04 +01:00
parent a042966082
commit 98034e5504
2 changed files with 3 additions and 4 deletions

View File

@@ -5,14 +5,13 @@ module http
import os
pub fn download_file(url string, out string) bool {
pub fn download_file(url string, out string)? {
$if debug_http? {
println('download file url=$url out=$out')
}
s := get(url) or {
return false
return error(err)
}
os.write_file(out, s.text)
return true
// download_file_with_progress(url, out, empty, empty)
}