Currently, unsafeBytesToString function violates the 6th rule of unsafe
pointer usage. That is, reflect.SliceHeader/String header should never
be used as plain struct. This misuse can make to silent memory
corruption, which can be difficult to track down when problem occurred.
Instead, use the more (right) idiom to convert slice of byte to string
without heap allocation.
goos: linux
goarch: amd64
cpu: Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz
BenchmarkInvalid-8 1000000000 0.497 ns/op 0 B/op 0 allocs/op
BenchmarkValid-8 1000000000 0.239 ns/op 0 B/op 0 allocs/op
PASS
ok command-line-arguments 0.815s