SYS-REQ-011, SYS-REQ-080, SYS-REQ-081, SYS-REQ-082 GetUnsafeString returns the value retrieved by `Get`, use creates string without memory allocation by mapping string to slice memory. It does not handle escape symbols.
(data []byte, keys ...string)
| 1474 | // SYS-REQ-011, SYS-REQ-080, SYS-REQ-081, SYS-REQ-082 |
| 1475 | // GetUnsafeString returns the value retrieved by `Get`, use creates string without memory allocation by mapping string to slice memory. It does not handle escape symbols. |
| 1476 | func GetUnsafeString(data []byte, keys ...string) (val string, err error) { |
| 1477 | v, _, _, e := Get(data, keys...) |
| 1478 | |
| 1479 | if e != nil { |
| 1480 | return "", e |
| 1481 | } |
| 1482 | |
| 1483 | return bytesToString(&v), nil |
| 1484 | } |
| 1485 | |
| 1486 | // SYS-REQ-002, SYS-REQ-071, SYS-REQ-072, SYS-REQ-073, SYS-REQ-074 |
| 1487 | // GetString returns the value retrieved by `Get`, cast to a string if possible, trying to properly handle escape and utf8 symbols |