From 3fa27005980a1275422585bf3398221f4a87b5b8 Mon Sep 17 00:00:00 2001 From: smallwhite Date: Thu, 24 Jan 2019 21:24:31 +0800 Subject: [PATCH] Update ch2-07-memory.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix code. byte 溢出 `constant 1234 overflows byte` --- ch2-cgo/ch2-07-memory.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ch2-cgo/ch2-07-memory.md b/ch2-cgo/ch2-07-memory.md index d105b13..88e848e 100644 --- a/ch2-cgo/ch2-07-memory.md +++ b/ch2-cgo/ch2-07-memory.md @@ -32,9 +32,9 @@ func freeByteSlice(p []byte) { func main() { s := makeByteSlize(1<<32+1) - s[len[s]-1] = 1234 - print(s[len[s]-1]) - freeByteSlice(p) + s[len(s)-1] = 255 + print(s[len(s)-1]) + freeByteSlice(s) } ```