Add appends key value pair to the sequence.
(k string, v JSON)
| 259 | |
| 260 | // Add appends key value pair to the sequence. |
| 261 | func (b *ObjectBuilder) Add(k string, v JSON) { |
| 262 | if b.pairs == nil { |
| 263 | panic(errors.AssertionFailedf(msgModifyAfterBuild)) |
| 264 | } |
| 265 | b.pairs = append(b.pairs, jsonKeyValuePair{k: jsonString(k), v: v}) |
| 266 | } |
| 267 | |
| 268 | // Build returns a JSON object built from a key value pair sequence. After that, |
| 269 | // it should not be modified any longer. |
no test coverage detected