MCPcopy
hub / github.com/perkeep/perkeep / MustNew

Function MustNew

pkg/index/indextest/tests.go:1458–1465  ·  view source on GitHub ↗

MustNew wraps index.New and fails with a Fatal error on t if New returns an error.

(t *testing.T, s sorted.KeyValue)

Source from the content-addressed store, hash-verified

1456// MustNew wraps index.New and fails with a Fatal error on t if New
1457// returns an error.
1458func MustNew(t *testing.T, s sorted.KeyValue) *index.Index {
1459 t.Helper()
1460 ix, err := index.New(s)
1461 if err != nil {
1462 t.Fatalf("Error creating index: %v", err)
1463 }
1464 return ix
1465}

Callers 2

indexTestFunction · 0.92
testMethod · 0.92

Calls 2

NewFunction · 0.92
FatalfMethod · 0.65

Tested by 2

indexTestFunction · 0.74
testMethod · 0.74