Add appends key value pair to the sequence.
(k string, v JSON)
| 375 | |
| 376 | // Add appends key value pair to the sequence. |
| 377 | func (b *ObjectBuilder) Add(k string, v JSON) { |
| 378 | if b.built { |
| 379 | panic(errors.AssertionFailedf(msgModifyAfterBuild)) |
| 380 | } |
| 381 | b.pairs = append(b.pairs, jsonKeyValuePair{k: jsonString(k), v: v}) |
| 382 | } |
| 383 | |
| 384 | // Build returns a JSON object built from a key value pair sequence. After that, |
| 385 | // it should not be modified any longer. |