Build builds JSON object.
()
| 452 | |
| 453 | // Build builds JSON object. |
| 454 | func (b *FixedKeysObjectBuilder) Build() (JSON, error) { |
| 455 | if b.updated.Len() != len(b.pairs) { |
| 456 | return nil, errors.AssertionFailedf( |
| 457 | "expected all %d keys to be updated, %d updated", |
| 458 | len(b.pairs), b.updated.Len()) |
| 459 | } |
| 460 | b.updated = intsets.Fast{} |
| 461 | // Must copy b.pairs in case builder is reused. |
| 462 | return jsonObject(append([]jsonKeyValuePair(nil), b.pairs...)), nil |
| 463 | } |
| 464 | |
| 465 | // PartialObject is a JSON object builder that builds an object using a set of |
| 466 | // fixed key-values (supplied at construction) and a set of keys which are |
nothing calls this directly
no test coverage detected