--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
package a
import (
"flag"
"fmt"
"os"
"testing"
)
var theflag string
func init() {
flag.StringVar(&theflag, "theflag", "", "desc")
}
func TestMain(m *testing.M) {
fmt.Printf("'%v'\n", theflag)
os.Exit(m.Run())
}
func TestFoo(t *testing.T) {
fmt.Printf("'%v'\n", theflag)
}
The minimal implementation of TestMain is:func TestMain(m *testing.M) { os.Exit(m.Run()) }