mirror of
https://github.com/taigrr/wasm-experiments
synced 2025-01-18 04:03:21 -08:00
channels: sum up to positive
TinyGo can't quite handle a negative result, so switch the channels example to sum up to something positive.
This commit is contained in:
@@ -13,7 +13,7 @@ func sum(s []int, c chan int) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
s := []int{7, 2, 8, -9, 4, 0}
|
||||
s := []int{7, 2, 8, 9, -4, 0}
|
||||
|
||||
c := make(chan int)
|
||||
go sum(s[:len(s)/2], c)
|
||||
|
||||
Reference in New Issue
Block a user