From 182fadeec0bca2fef33cb91c1efb096c88c59c1f Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Fri, 11 Oct 2013 16:39:05 -0700 Subject: [PATCH] [x/blog] go.blog/slices: make slice-header-modifying example actually modify it Fixes golang/go#6570. R=golang-dev, adg CC=golang-dev https://golang.org/cl/14614043 X-Blog-Commit: 190a69e0573a68c27a4cbda968fadf4eec3c1d60 --- blog/content/slices/prog020.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blog/content/slices/prog020.go b/blog/content/slices/prog020.go index 4652722e..472f68af 100644 --- a/blog/content/slices/prog020.go +++ b/blog/content/slices/prog020.go @@ -12,7 +12,8 @@ var buffer [256]byte var slice []byte = buffer[100:150] func SubtractOneFromLength(slice []byte) []byte { - return slice[0 : len(slice)-1] + slice = slice[0 : len(slice)-1] + return slice } func main() {