(s string)
| 2430 | } |
| 2431 | |
| 2432 | func (j jsonObject) RemoveString(s string) (JSON, bool, error) { |
| 2433 | idx, ok := findPairIndexByKey(j, s) |
| 2434 | if !ok { |
| 2435 | return j, false, nil |
| 2436 | } |
| 2437 | |
| 2438 | newVal := make([]jsonKeyValuePair, len(j)-1) |
| 2439 | copy(newVal, j[:idx]) |
| 2440 | copy(newVal[idx:], j[idx+1:]) |
| 2441 | return jsonObject(newVal), true, nil |
| 2442 | } |
| 2443 | |
| 2444 | func (jsonNull) RemoveString(string) (JSON, bool, error) { |
| 2445 | return nil, false, errCannotDeleteFromScalar |
no test coverage detected