This example demonstrates how to use a ConfigState.
()
| 143 | |
| 144 | // This example demonstrates how to use a ConfigState. |
| 145 | func 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 |