MCPcopy Index your code
hub / github.com/expr-lang/expr / ExampleConfigState

Function ExampleConfigState

internal/spew/example_test.go:145–160  ·  view source on GitHub ↗

This example demonstrates how to use a ConfigState.

()

Source from the content-addressed store, hash-verified

143
144// This example demonstrates how to use a ConfigState.
145func ExampleConfigState() {
146 // Modify the indent level of the ConfigState only. The global
147 // configuration is not modified.
148 scs := spew.ConfigState{Indent: "\t"}
149
150 // Output using the ConfigState instance.
151 v := map[string]int{"one": 1}
152 scs.Printf("v: %v\n", v)
153 scs.Dump(v)
154
155 // Output:
156 // v: map[one:1]
157 // (map[string]int) (len=1) {
158 // (string) (len=3) "one": (int) 1
159 // }
160}
161
162// This example demonstrates how to use ConfigState.Dump to dump variables to
163// stdout

Callers

nothing calls this directly

Calls 2

PrintfMethod · 0.95
DumpMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…