1 // Copyright 2015 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.
18 var initCh = make(chan int, 1)
22 // emulate an exceedingly slow package initialization function
23 time.Sleep(100 * time.Millisecond)
27 func main() { ranMain = true }
30 func DidInitRun() bool {
34 // Just in case initCh was not correctly made.
35 println("want init value of 42, got: ", x)
45 func DidMainRun() bool { return ranMain }
49 if len(os.Args) != 3 || os.Args[1] != "arg1" || os.Args[2] != "arg2" {
50 fmt.Printf("CheckArgs: want [_, arg1, arg2], got: %v\n", os.Args)