| 36 | ) |
| 37 | |
| 38 | type jsonEncoded struct { |
| 39 | // containerLength is only set if this is an object or an array. |
| 40 | containerLen int |
| 41 | typ Type |
| 42 | // value contains the encoding of this JSON value. In the case of |
| 43 | // arrays and objects, value contains the container header, but it never |
| 44 | // contains a scalar container header. |
| 45 | value []byte |
| 46 | |
| 47 | // TODO(justin): for simplicity right now we use a mutex, we could be using |
| 48 | // an atomic CAS though. |
| 49 | mu struct { |
| 50 | sync.RWMutex |
| 51 | |
| 52 | cachedDecoded JSON |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | const jsonEncodedSize = unsafe.Sizeof(jsonEncoded{}) |
| 57 |
nothing calls this directly
no outgoing calls
no test coverage detected