jeudi 2 mai 2019

Go: Print text after the suite has run?

The testing package captures all output and will not print it unless a test fails or verbose (-v) is turned on. Is there a way to output text after the suite is finished without needing verbose turned on?

For example:

func TestMain(m *testing.M) {
    status := m.Run(m)
    fmt.Println("important line to output")
    os.Exit(status)
}

Will not print the line.

Aucun commentaire:

Enregistrer un commentaire