mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
examples/news_fetcher.v: now displays story URL, not just title
This commit is contained in:
parent
ac53a4a2ab
commit
539bebcc22
1 changed files with 2 additions and 1 deletions
|
@ -13,6 +13,7 @@ const (
|
||||||
|
|
||||||
struct Story {
|
struct Story {
|
||||||
title string
|
title string
|
||||||
|
url string
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Fetcher {
|
struct Fetcher {
|
||||||
|
@ -36,7 +37,7 @@ fn (f mut Fetcher) fetch() {
|
||||||
println('failed to decode a story')
|
println('failed to decode a story')
|
||||||
exit(1)
|
exit(1)
|
||||||
}
|
}
|
||||||
println('#$f.cursor) $story.title')
|
println('#$f.cursor) $story.title | $story.url')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue