(d any)
| 205 | } |
| 206 | |
| 207 | func (cw *countWriter) writeDynamic(d any) { |
| 208 | if cw.err != nil { |
| 209 | return |
| 210 | } |
| 211 | switch d := d.(type) { |
| 212 | case string: |
| 213 | cw.writeJSONString(d) |
| 214 | case *Tree: |
| 215 | // TODO - we want to include statics and diff them out elsewhere |
| 216 | d.writeTo(cw) |
| 217 | default: |
| 218 | panic(fmt.Sprintf("unexpected type of Dynamic: %T, want string or *Tree, value is: %v", d, d)) |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | // WriteTo writes a JSON representation of the tree to w. |
| 223 | func (t *Tree) WriteTo(w io.Writer) (written int64, err error) { |
no test coverage detected