From ed82bbd2f338e0b068038853c5b81f6d0e0d53cb Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Tue, 8 Jul 2025 13:16:53 +0300 Subject: [PATCH] doc: err is --- doc/docs.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/docs.md b/doc/docs.md index 080d04782e..229708de2a 100644 --- a/doc/docs.md +++ b/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