1
0
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:
Johan Brandhorst
2019-02-26 21:16:15 +00:00
parent 3f3a4ea966
commit 879c37868b
4 changed files with 1 additions and 481 deletions

View File

@@ -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)