diff options
| author | Rob Pike <r@golang.org> | 2009-12-16 10:29:53 +1100 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2009-12-16 10:29:53 +1100 |
| commit | aea97e0bd7da9cef1cc631ddbd3578a0877a4fcc (patch) | |
| tree | 89f2452373bd20e8248aee25ea00a592177bca95 /doc/progs/sum.go | |
| parent | 881d6064d23d9da5c7ff368bc7d41d271290deff (diff) | |
| download | golang-aea97e0bd7da9cef1cc631ddbd3578a0877a4fcc.tar.gz | |
update tutorial.
R=rsc
CC=golang-dev
http://codereview.appspot.com/179063
Diffstat (limited to 'doc/progs/sum.go')
| -rw-r--r-- | doc/progs/sum.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/progs/sum.go b/doc/progs/sum.go index f087ca3e5..74fd5bca3 100644 --- a/doc/progs/sum.go +++ b/doc/progs/sum.go @@ -7,7 +7,7 @@ package main import "fmt" func sum(a []int) int { // returns an int - s := 0; + s := 0 for i := 0; i < len(a); i++ { s += a[i] } @@ -16,6 +16,6 @@ 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 - fmt.Print(s, "\n"); + s := sum(&[3]int{1,2,3}) // a slice of the array is passed to sum + fmt.Print(s, "\n") } |
