Brad Fitzpatrick | e014cf0 | 2012-02-24 13:17:26 +1100 | [diff] [blame] | 1 | // cmpout |
Stephen Ma | b4bb970 | 2011-06-13 22:50:51 +1000 | [diff] [blame] | 2 | |
Emmanuel Odeke | 53fd522 | 2016-04-10 14:32:26 -0700 | [diff] [blame] | 3 | // Copyright 2011 The Go Authors. All rights reserved. |
Stephen Ma | b4bb970 | 2011-06-13 22:50:51 +1000 | [diff] [blame] | 4 | // Use of this source code is governed by a BSD-style |
| 5 | // license that can be found in the LICENSE file. |
| 6 | |
Rob Pike | 83976e3 | 2012-02-19 14:28:53 +1100 | [diff] [blame] | 7 | // Test that println can be the target of a go statement. |
| 8 | |
Stephen Ma | b4bb970 | 2011-06-13 22:50:51 +1000 | [diff] [blame] | 9 | package main |
| 10 | |
Richard Miller | a25e368 | 2016-04-06 18:42:14 +0100 | [diff] [blame] | 11 | import ( |
| 12 | "runtime" |
| 13 | "time" |
| 14 | ) |
Stephen Ma | b4bb970 | 2011-06-13 22:50:51 +1000 | [diff] [blame] | 15 | |
| 16 | func main() { |
| 17 | go println(42, true, false, true, 1.5, "world", (chan int)(nil), []int(nil), (map[string]int)(nil), (func())(nil), byte(255)) |
Richard Miller | a25e368 | 2016-04-06 18:42:14 +0100 | [diff] [blame] | 18 | for runtime.NumGoroutine() > 1 { |
| 19 | time.Sleep(10*time.Millisecond) |
| 20 | } |
Stephen Ma | b4bb970 | 2011-06-13 22:50:51 +1000 | [diff] [blame] | 21 | } |