| 22 | ) |
| 23 | |
| 24 | type jsonEncoded struct { |
| 25 | // containerLength is only set if this is an object or an array. |
| 26 | containerLen int |
| 27 | typ Type |
| 28 | // value contains the encoding of this JSON value. In the case of |
| 29 | // arrays and objects, value contains the container header, but it never |
| 30 | // contains a scalar container header. |
| 31 | value []byte |
| 32 | |
| 33 | // TODO(justin): for simplicity right now we use a mutex, we could be using |
| 34 | // an atomic CAS though. |
| 35 | mu struct { |
| 36 | sync.RWMutex |
| 37 | |
| 38 | cachedDecoded JSON |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | const jsonEncodedSize = unsafe.Sizeof(jsonEncoded{}) |
| 43 |
nothing calls this directly
no outgoing calls
no test coverage detected