Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite unsafeStringToBytes to satisfy 1.16 vet check (#466)
Fixes #465. According to https://golang.org/pkg/unsafe/#Pointer (6), one of the only safe ways to use pointers: > Conversion of a reflect.SliceHeader or reflect.StringHeader Data field to or from Pointer. ... > In general, reflect.SliceHeader and reflect.StringHeader should be used only as *reflect.SliceHeader and *reflect.StringHeader pointing at actual slices or strings, never as plain structs. A program should not declare or allocate variables of these struct types. This rewrites the unsafe to only modify to not allocate a `reflect.SliceHeader ` manually making the vet check happy.
- Loading branch information