Solution Review: Summing the Integers

This lesson discusses the solution to the challenge given in the previous lesson.

package main
import (
"fmt"
)
func sum(x, y int, c chan int) {
c <- x + y
}
func main() {
c := make(chan int)
go sum(12, 13, c)
fmt.Println(<-c) // 25
}

Get hands-on with 1200+ tech skills courses.