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

http: return ?string

This commit is contained in:
Delyan Angelov
2019-07-29 20:18:26 +03:00
committed by Alexander Medvednikov
parent ba6bcdb469
commit 4a1970a322
3 changed files with 32 additions and 20 deletions

View File

@ -5,7 +5,10 @@
import http
fn main() {
html := http.get('https://news.ycombinator.com')
html := http.get('https://news.ycombinator.com') or {
println('Failed fetching from URL')
return
}
mut pos := 0
for {
pos = html.index_after('https://', pos + 1)