• David Symonds's avatar
    exp/types: avoid init race in check_test.go. · 80f4ff22
    David Symonds authored
    There was an init race between
    	check_test.go:init
            universe.go:def
            use of Universe
    and
    	universe.go:init
            creation of Universe
    
    The order in which init funcs are executed in a package is unspecified.
    The test is not currently broken in the golang.org environment
    because the go tool compiles the test with non-test sources before test sources,
    but other environments may, say, sort the source files before compiling,
    and thus trigger this race, causing a nil pointer panic.
    
    R=gri
    CC=golang-dev
    https://golang.org/cl/6827076
    80f4ff22
check_test.go 7.43 KB