mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
doc: add a go fn() {}
example (#15134)
This commit is contained in:
parent
f27c0387ad
commit
9995063304
@ -3601,6 +3601,11 @@ fn p(a f64, b f64) { // ordinary function without return value
|
||||
fn main() {
|
||||
go p(3, 4)
|
||||
// p will be run in parallel thread
|
||||
// It can also be written as follows
|
||||
// go fn (a f64, b f64) {
|
||||
// c := math.sqrt(a * a + b * b)
|
||||
// println(c)
|
||||
// }(3, 4)
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user