From c94a5c661343ce58cd5858eda389f73f60718fa5 Mon Sep 17 00:00:00 2001 From: "Stephen M. McQuay" Date: Mon, 27 Aug 2012 22:28:04 -0600 Subject: [PATCH] added a few more things to the slices example --- slices/go.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/slices/go.go b/slices/go.go index 78e0bd3..05ab9c8 100644 --- a/slices/go.go +++ b/slices/go.go @@ -18,8 +18,12 @@ func main() { fmt.Println("p[:3] == ", p[:3]) fmt.Println("p[4:] == ", p[4:]) - v := make([]string, 0) + v := make([]string, 30, 1024) + fmt.Printf("%v\n", v) + fmt.Printf("%v\n", cap(v)) v = append(v, "hello", "world") fmt.Printf("%v\n", v) + 界 := 12.34 + fmt.Printf("%v\n", 界) }