mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
13 lines
124 B
V
13 lines
124 B
V
fn test_optional_void() {
|
|
foo(22)?
|
|
assert true
|
|
}
|
|
|
|
fn foo(n int) ? {
|
|
if n > 0 {
|
|
println(n)
|
|
} else {
|
|
return none
|
|
}
|
|
}
|