mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
http: refactor and reduce duplication
This commit is contained in:
parent
756c6d2858
commit
84a6c019e8
8 changed files with 274 additions and 88 deletions
|
@ -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])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue