From 8e8ee0cb75e784c31065316bc3cfc9e7d23a28a8 Mon Sep 17 00:00:00 2001 From: Jiepeng Cao Date: Thu, 1 Mar 2018 23:08:23 +0800 Subject: [PATCH] typo bytes2str --- ch1-basic/ch1-03-array-string-and-slice.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch1-basic/ch1-03-array-string-and-slice.md b/ch1-basic/ch1-03-array-string-and-slice.md index 8b8b732..d9d98b4 100644 --- a/ch1-basic/ch1-03-array-string-and-slice.md +++ b/ch1-basic/ch1-03-array-string-and-slice.md @@ -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))