MCPcopy Create free account
hub / github.com/zalando/skipper / TestContextDefault

Function TestContextDefault

routing/context_test.go:23–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21}
22
23func TestContextDefault(t *testing.T) {
24 ctx := context.Background()
25 nctx := NewContext(ctx)
26
27 defaultVal := func() string { return "default" }
28 if v := FromContext(nctx, "foo", defaultVal); v != "default" {
29 t.Fatalf("Failed to get \"default\", got %q", v)
30 }
31}

Callers

nothing calls this directly

Calls 2

NewContextFunction · 0.85
FromContextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…