mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
doc: document x := ?int(none)
This commit is contained in:
parent
cbc7477ecf
commit
f3624d58cf
1 changed files with 17 additions and 12 deletions
|
@ -3973,6 +3973,11 @@ fn main() {
|
|||
println(user.name) // "Charles"
|
||||
|
||||
user2 := repo.find_user_by_id2(10) or { return }
|
||||
|
||||
// To create an Option var directly:
|
||||
my_optional_int := ?int(none)
|
||||
my_optional_string := ?string(none)
|
||||
my_optional_user := ?User(none)
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue