MCPcopy Create free account
hub / github.com/coder/slog / Success

Function Success

sloggers/slogtest/assert/assert.go:37–45  ·  view source on GitHub ↗

Success asserts err == nil.

(t testing.TB, name string, err error)

Source from the content-addressed store, hash-verified

35
36// Success asserts err == nil.
37func Success(t testing.TB, name string, err error) {
38 slog.Helper()
39 if err != nil {
40 slogtest.Fatal(t, "unexpected error",
41 slog.F("name", name),
42 slog.Error(err),
43 )
44 }
45}
46
47// True asserts act == true.
48func True(t testing.TB, name string, act bool) {

Callers 1

TestSuccessFunction · 0.92

Calls 3

FatalFunction · 0.92
HelperMethod · 0.45
ErrorMethod · 0.45

Tested by 1

TestSuccessFunction · 0.74