Use CXXCOMPILE in gold/testsuite/Makefile for c++ testcases
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.go / chan.go
CommitLineData
a766d390
DE
1package main
2
3import "fmt"
4
5func generate() chan int {
6 ch := make(chan int)
7 go func() {
8 for i := 0; ; i++ {
9 ch <- i // set breakpoint 1 here
10 }
11 }()
12 return ch
13}
14
15func main() {
16 integers := generate()
17 for i := 0; i < 100; i++ { // Print the first hundred integers.
18 fmt.Println(<-integers) // set breakpoint 2 here
19 }
20}
This page took 0.929214 seconds and 4 git commands to generate.