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:
parent
67c43df428
commit
8e8ee0cb75
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user