From 3e609a8872e69b2df7447de5f308a5d4340f1cbf Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Mon, 30 Jan 2012 15:38:19 +0100 Subject: Imported Upstream version 2012.01.27 --- doc/progs/sum.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc/progs/sum.go') diff --git a/doc/progs/sum.go b/doc/progs/sum.go index e022195ed..0f316bc01 100644 --- a/doc/progs/sum.go +++ b/doc/progs/sum.go @@ -15,6 +15,7 @@ func sum(a []int) int { // returns an int } func main() { - s := sum([3]int{1, 2, 3}[:]) // a slice of the array is passed to sum + x := [3]int{1, 2, 3} + s := sum(x[:]) // a slice of the array is passed to sum fmt.Print(s, "\n") } -- cgit v1.2.3