Debian Codegraph @

test/typeparam/select.dir/main.go

raw
1 // Copyright 2021 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package main
6
7 import (
8 "sort"
9
10 "./a"
11 )
12
13 func main() {
14 c := make(chan int, 1)
15 d := make(chan int, 1)
16
17 c <- 5
18 d <- 6
19
20 var r [2]int
21 r[0] = a.F(c, d)
22 r[1] = a.F(c, d)
23 sort.Ints(r[:])
24
25 if r != [2]int{5, 6} {
26 panic("incorrect results")
27 }
28 }