github.com/driusan/dgit@v0.0.0-20221118233547-f39f0c15edbb/git/main_test.go (about)

     1  package git
     2  
     3  import (
     4  	"flag"
     5  	"io/ioutil"
     6  	"log"
     7  	"os"
     8  	"testing"
     9  )
    10  
    11  func TestMain(m *testing.M) {
    12  	log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
    13  	flag.Parse()
    14  	if !testing.Verbose() {
    15  		log.SetOutput(ioutil.Discard)
    16  	}
    17  	code := m.Run()
    18  	os.Exit(code)
    19  }