commit | 4f4c90a30c66c1d83d1c843c542e193c494b718a | [log] [tgz] |
---|---|---|
author | Katrina Owen <katrina.owen@gmail.com> | Tue Feb 09 18:23:06 2016 +1100 |
committer | Andrew Gerrand <adg@golang.org> | Tue Feb 09 07:45:29 2016 +0000 |
tree | dbf77de2ed1e2fa2a309c112f85d89ac18485e9e | |
parent | cff7eeccd800bfca4fb1349651a0a2fcc95fcc7c [diff] |
content: rename variable in nil slices example The name z for a slice is a bit cryptic. In retrospect it does make sense ("zero value of a slice"), but a straight-forward s for slice seems better here. Change-Id: I7afae523a8f567d3221299e4c0c9fa47789961cf Reviewed-on: https://go-review.googlesource.com/19403 Reviewed-by: Andrew Gerrand <adg@golang.org>
diff --git a/content/moretypes/nil-slices.go b/content/moretypes/nil-slices.go index daa9ddc..a317027 100644 --- a/content/moretypes/nil-slices.go +++ b/content/moretypes/nil-slices.go
@@ -5,9 +5,9 @@ import "fmt" func main() { - var z []int - fmt.Println(z, len(z), cap(z)) - if z == nil { + var s []int + fmt.Println(s, len(s), cap(s)) + if s == nil { fmt.Println("nil!") } }