MCPcopy
hub / github.com/dgraph-io/dgraph / AssertTrue

Function AssertTrue

x/error.go:83–87  ·  view source on GitHub ↗

AssertTrue asserts that b is true. Otherwise, it would log fatal.

(b bool)

Source from the content-addressed store, hash-verified

81
82// AssertTrue asserts that b is true. Otherwise, it would log fatal.
83func AssertTrue(b bool) {
84 if !b {
85 log.Fatalf("%+v", errors.Errorf("Assert failed"))
86 }
87}
88
89// AssertTruef is AssertTrue with extra info.
90func AssertTruef(b bool, format string, args ...interface{}) {

Callers 15

mismatchedLessFunction · 0.92
stringHelperMethod · 0.92
popAssertMethod · 0.92
SetRaftMethod · 0.92
validateAndGetReverseFunction · 0.92
initProposalKeyMethod · 0.92
applyProposalMethod · 0.92
InformMethod · 0.92
ShouldServeMethod · 0.92
runMethod · 0.92
toListMethod · 0.92
marshalCountEntryFunction · 0.92

Calls 2

FatalfMethod · 0.80
ErrorfMethod · 0.45

Tested by 5

TestMainFunction · 0.74
TestVectorSchemaFunction · 0.74
runQueryFunction · 0.74
TestNoConflictQuery2Function · 0.74
tokensForTestFunction · 0.74