File: maint.go

package info (click to toggle)
gotest.tools 3.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-proposed-updates, bullseye, sid
  • size: 600 kB
  • sloc: makefile: 11; sh: 6
file content (28 lines) | stat: -rw-r--r-- 563 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package maint // import "gotest.tools/v3/internal/maint"

import (
	"fmt"
	"os"
)

// T provides an implementation of assert.TestingT which uses os.Exit, and
// fmt.Println. This implementation can be used outside of test cases to provide
// assert.TestingT, for example in a TestMain.
var T = t{}

type t struct{}

// FailNow exits with a non-zero code
func (t t) FailNow() {
	os.Exit(1)
}

// Fail exits with a non-zero code
func (t t) Fail() {
	os.Exit(2)
}

// Log args by printing them to stdout
func (t t) Log(args ...interface{}) {
	fmt.Println(args...)
}