toString converts the json encoded string value val to a go string. It should be used only in scenarios where the underlying string is simple, i.e., it doesn't contain any escape sequence or any other string magic. Otherwise, better to use json.Unmarshal().
(val []byte)
| 1398 | // It should be used only in scenarios where the underlying string is simple, i.e., it doesn't |
| 1399 | // contain any escape sequence or any other string magic. Otherwise, better to use json.Unmarshal(). |
| 1400 | func toString(val []byte) string { |
| 1401 | return strings.Trim(string(val), `"`) // remove `"` from beginning and end |
| 1402 | } |
| 1403 | |
| 1404 | // checkAndStripComma checks whether there is a comma at the end of the given buffer. If yes, |
| 1405 | // it removes that comma from the buffer. |
no outgoing calls
no test coverage detected