From ebdfe9a9c550df0959537687b3dd224d5d2c66c2 Mon Sep 17 00:00:00 2001 From: yuyi Date: Mon, 18 May 2020 20:35:51 +0800 Subject: [PATCH] doc: correct an example --- doc/docs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/docs.md b/doc/docs.md index fc945aee63..f70e0eda0d 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -1199,7 +1199,7 @@ You can also propagate errors: ```v resp := http.get(url)? -println(resp.body) +println(resp.text) ``` `http.get` returns `?http.Response`. Because it was called with `?`, the error will be propagated to the calling function @@ -1211,7 +1211,7 @@ The code above is essentially a condensed version of resp := http.get(url) or { return error(err) } -println(resp.body) +println(resp.text) ``` V does not have a way to forcibly "unwrap" an optional (as other languages do, for instance Rust's `unwrap()`