mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
There are alternative formulations of this, for instance see https://www.reddit.com/r/golang/comments/5zctpf/unsafe_conversion_between_strings_and_byte_slices/ The problem manifested in the returned values from unsafeBytes occasionally being broken. It's possible that by keeping a reference to the `a` parameter alive, the original code would still work - however, this definitely seems like a fix. (A cast to `[]byte(a)` looks increasingly attractive, for all that it'll perform small allocations and copies.)