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

http: refactor and reduce duplication

This commit is contained in:
Chris Watson
2020-01-16 10:16:11 -07:00
committed by Alexander Medvednikov
parent 756c6d2858
commit 84a6c019e8
8 changed files with 274 additions and 88 deletions

View File

@ -1,7 +1,7 @@
import net.http
fn main() {
html := http.get_text('https://news.ycombinator.com')
html := http.get_text('https://news.ycombinator.com')
mut pos := 0
for {
pos = html.index_after('https://', pos + 1)
@ -12,4 +12,3 @@ fn main() {
println(html[pos..end])
}
}