Skip to content

Commit ed82bbd

Browse files
committed
doc: err is
1 parent 47145ea commit ed82bbd

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎doc/docs.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4190,6 +4190,18 @@ user := repo.find_user_by_id(7) or {
41904190
}
41914191
```
41924192

4193+
Use `err is ...` to compare errors:
4194+
```v oksyntax
4195+
import io
4196+
4197+
x := read() or {
4198+
if err is io.Eof {
4199+
println('end of file')
4200+
}
4201+
return
4202+
}
4203+
```
4204+
41934205
#### Options/results when returning multiple values
41944206

41954207
Only one `Option` or `Result` is allowed to be returned from a function. It is

0 commit comments

Comments
 (0)