MCPcopy Index your code
hub / github.com/riverqueue/river / TestValOrDefaultFunc

Function TestValOrDefaultFunc

rivershared/util/ptrutil/ptr_util_test.go:31–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29}
30
31func TestValOrDefaultFunc(t *testing.T) {
32 t.Parallel()
33
34 val := "val"
35 require.Equal(t, val, ValOrDefaultFunc(&val, func() string { return "default" }))
36 require.Equal(t, "default", ValOrDefaultFunc((*string)(nil), func() string { return "default" }))
37}

Callers

nothing calls this directly

Calls 1

ValOrDefaultFuncFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…