mirror of
https://github.com/golang/go
synced 2024-11-24 07:10:18 -07:00
add tests for the func()() case
R=gri DELTA=12 (12 added, 0 deleted, 0 changed) OCL=34601 CL=34601
This commit is contained in:
parent
a5d6f8342c
commit
5e11bb259b
@ -52,6 +52,11 @@ func three(x int) {
|
||||
|
||||
var notmain func()
|
||||
|
||||
func emptyresults() () {}
|
||||
func noresults() {}
|
||||
|
||||
var nothing func()
|
||||
|
||||
func main() {
|
||||
three(call(add, 1, 2));
|
||||
three(call1(add, 1, 2));
|
||||
@ -73,5 +78,12 @@ func main() {
|
||||
three(<-c);
|
||||
go func(a, b int, c chan int){c <- a+b}(1, 2, c);
|
||||
three(<-c);
|
||||
|
||||
emptyresults();
|
||||
noresults();
|
||||
nothing = emptyresults;
|
||||
nothing();
|
||||
nothing = noresults;
|
||||
nothing();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user