mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: automatic error propagation in place of "or { return(err) }"
This commit is contained in:
@@ -23,13 +23,9 @@ fn http_fetch_mock(_methods []string, _config FetchConfig) ?[]Response {
|
||||
for method in methods {
|
||||
lmethod := method.to_lower()
|
||||
config.method = method
|
||||
res := fetch(url + lmethod, config) or {
|
||||
return error(err)
|
||||
}
|
||||
res := fetch(url + lmethod, config)?
|
||||
// TODO
|
||||
// body := json.decode(HttpbinResponseBody,res.text) or {
|
||||
// return error(err)
|
||||
// }
|
||||
// body := json.decode(HttpbinResponseBody,res.text)?
|
||||
result << res
|
||||
}
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user