(s string)
| 1417 | } |
| 1418 | |
| 1419 | func (j jsonObject) RemoveString(s string) (JSON, bool, error) { |
| 1420 | idx, ok := findPairIndexByKey(j, s) |
| 1421 | if !ok { |
| 1422 | return j, false, nil |
| 1423 | } |
| 1424 | |
| 1425 | newVal := make([]jsonKeyValuePair, len(j)-1) |
| 1426 | copy(newVal, j[:idx]) |
| 1427 | copy(newVal[idx:], j[idx+1:]) |
| 1428 | return jsonObject(newVal), true, nil |
| 1429 | } |
| 1430 | |
| 1431 | func (jsonNull) RemoveString(string) (JSON, bool, error) { |
| 1432 | return nil, false, errCannotDeleteFromScalar |
no test coverage detected