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:

committed by
Alexander Medvednikov

parent
ba6bcdb469
commit
4a1970a322
@ -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)
|
||||
|
Reference in New Issue
Block a user