1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-24 04:16:01 +00:00

typo bytes2str

This commit is contained in:
Jiepeng Cao 2018-03-01 23:08:23 +08:00 committed by GitHub
parent 67c43df428
commit 8e8ee0cb75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -299,7 +299,7 @@ func str2bytes(s string) []byte {
func bytes2str(s []byte) (p string) {
data := make([]byte, len(s))
for i, c := s {
p[i] = c
data[i] = c
}
hdr := (*reflect.StringHeader)(unsafe.Pointer(&p))