Created
July 2, 2022 23:00
-
-
Save ad3n/fe9dc2747ac93cb5c92e96e72e9c66ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func doubling(n int) int { | |
return 2 * n | |
} | |
func main() { | |
cNumber := make(chan int) | |
for i := 0; i <= 10; i++ { | |
go func(i int) { | |
//TODO | |
}(i) | |
} | |
for i := 0; i <= 10; i++ { | |
var n int | |
n = <-cNumber | |
fmt.Println(doubling(n)) | |
} | |
go func() { | |
for i := 0; i <= 10; i++ { | |
//TODO | |
} | |
}() | |
for i := 0; i <= 10; i++ { | |
var result int | |
result = doubling(<-cNumber) | |
fmt.Println(result) | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment