(buf []byte, dir encoding.Direction)
| 2089 | } |
| 2090 | |
| 2091 | func (j jsonObject) EncodeForwardIndex(buf []byte, dir encoding.Direction) ([]byte, error) { |
| 2092 | buf = encoding.EncodeJSONObjectKeyMarker(buf, dir) |
| 2093 | buf = encoding.EncodeJSONValueLength(buf, dir, int64(len(j))) |
| 2094 | |
| 2095 | if buildutil.CrdbTestBuild { |
| 2096 | keys := make([]string, 0, j.Len()) |
| 2097 | for _, a := range j { |
| 2098 | keys = append(keys, string(a.k)) |
| 2099 | } |
| 2100 | if !sort.StringsAreSorted(keys) { |
| 2101 | return nil, errors.AssertionFailedf("unexpectedly unordered keys in jsonObject %s", j) |
| 2102 | } |
| 2103 | } |
| 2104 | |
| 2105 | var err error |
| 2106 | for _, a := range j { |
| 2107 | buf, err = a.k.EncodeForwardIndex(buf, dir) |
| 2108 | if err != nil { |
| 2109 | return nil, err |
| 2110 | } |
| 2111 | buf, err = a.v.EncodeForwardIndex(buf, dir) |
| 2112 | if err != nil { |
| 2113 | return nil, err |
| 2114 | } |
| 2115 | } |
| 2116 | buf = encoding.EncodeJSONKeyTerminator(buf, dir) |
| 2117 | return buf, nil |
| 2118 | } |
| 2119 | |
| 2120 | func (jsonNull) FetchValKey(string) (JSON, error) { return nil, nil } |
| 2121 | func (jsonTrue) FetchValKey(string) (JSON, error) { return nil, nil } |
nothing calls this directly
no test coverage detected