github.com/cybriq/giocore@v0.0.7-0.20210703034601-cfb9cb5f3900/cmd/gogio/main_test.go (about) 1 package main 2 3 import ( 4 "os" 5 "testing" 6 ) 7 8 func TestMain(m *testing.M) { 9 if os.Getenv("RUN_GOGIO") != "" { 10 // Allow the end-to-end tests to call the gogio tool without 11 // having to build it from scratch, nor having to refactor the 12 // main function to avoid using global variables. 13 main() 14 os.Exit(0) // main already exits, but just in case. 15 } 16 os.Exit(m.Run()) 17 }