Start translation to brazilian portuguese
This commit is contained in:
13
pt-br/code/src/apps/ch.2.7/buffered_channel/main.go
Normal file
13
pt-br/code/src/apps/ch.2.7/buffered_channel/main.go
Normal file
@@ -0,0 +1,13 @@
|
||||
// Example code for Chapter 2.7 from "Build Web Application with Golang"
|
||||
// Purpose: Shows how to use a buffered channel
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
c := make(chan int, 2) // change 2 to 1 will have runtime error, but 3 is fine
|
||||
c <- 1
|
||||
c <- 2
|
||||
fmt.Println(<-c)
|
||||
fmt.Println(<-c)
|
||||
}
|
||||
Reference in New Issue
Block a user