MCPcopy
hub / github.com/nats-io/nats.go / stackFatalf

Function stackFatalf

nats_test.go:64–79  ·  view source on GitHub ↗
(t *testing.T, f string, args ...any)

Source from the content-addressed store, hash-verified

62}
63
64func stackFatalf(t *testing.T, f string, args ...any) {
65 lines := make([]string, 0, 32)
66 msg := fmt.Sprintf(f, args...)
67 lines = append(lines, msg)
68
69 // Generate the Stack of callers: Skip us and verify* frames.
70 for i := 1; true; i++ {
71 _, file, line, ok := runtime.Caller(i)
72 if !ok {
73 break
74 }
75 msg := fmt.Sprintf("%d - %s:%d", i, file, line)
76 lines = append(lines, msg)
77 }
78 t.Fatalf("%s", strings.Join(lines, "\n"))
79}
80
81// Check the error channel for an error and if one is present,
82// calls t.Fatal(e.Error()). Note that this supports tests that

Callers 2

TestAsyncINFOFunction · 0.70
TestConnServersFunction · 0.70

Calls 1

FatalfMethod · 0.80

Tested by

no test coverage detected