mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
doc: err is
This commit is contained in:
parent
47145ea644
commit
ed82bbd2f3
1 changed files with 12 additions and 0 deletions
12
doc/docs.md
12
doc/docs.md
|
@ -4190,6 +4190,18 @@ user := repo.find_user_by_id(7) or {
|
|||
}
|
||||
```
|
||||
|
||||
Use `err is ...` to compare errors:
|
||||
```v oksyntax
|
||||
import io
|
||||
|
||||
x := read() or {
|
||||
if err is io.Eof {
|
||||
println('end of file')
|
||||
}
|
||||
return
|
||||
}
|
||||
```
|
||||
|
||||
#### Options/results when returning multiple values
|
||||
|
||||
Only one `Option` or `Result` is allowed to be returned from a function. It is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue