-
Notifications
You must be signed in to change notification settings - Fork 0
/
golden.go
34 lines (27 loc) · 970 Bytes
/
golden.go
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
29
30
31
32
33
34
package golden
import (
"errors"
)
// Golden file body type.
const (
// TypeText represents golden file text body type (default).
TypeText = "text"
// TypeJSON represents golden file JSON body type.
TypeJSON = "json"
)
// ErrUnknownUnmarshaler represents an error when unmarshaler for golden file
// body cannot be found.
var ErrUnknownUnmarshaler = errors.New("unknown unmarshaler")
// T is a subset of testing.TB interface.
// It's primarily used to test golden package but can be used to implement
// custom actions to be taken on errors.
type T interface {
// Fatal is equivalent to Log followed by FailNow.
Fatal(args ...interface{})
// Fatalf is equivalent to Logf followed by FailNow.
Fatalf(format string, args ...interface{})
// Helper marks the calling function as a test helper function.
// When printing file and line information, that function will be skipped.
// Helper may be called simultaneously from multiple goroutines.
Helper()
}