From cf6b1fe44aa0589fbaff9a69b8a1f1b3e147156d Mon Sep 17 00:00:00 2001 From: Mark McGranaghan Date: Tue, 27 Dec 2016 10:44:26 -0800 Subject: [PATCH] Rebuild for range changes --- examples/range/range.go | 2 +- examples/range/range.hash | 4 ++-- public/range | 21 +++++++++++++++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/examples/range/range.go b/examples/range/range.go index 3f1255e..7ae540d 100644 --- a/examples/range/range.go +++ b/examples/range/range.go @@ -36,7 +36,7 @@ func main() { // `range` can also iterate over just the keys of a map. for k := range kvs { - fmt.Println("key:", k) + fmt.Println("key:", k) } // `range` on strings iterates over Unicode code diff --git a/examples/range/range.hash b/examples/range/range.hash index 62a7d73..571157c 100644 --- a/examples/range/range.hash +++ b/examples/range/range.hash @@ -1,2 +1,2 @@ -db12ad8e0baad23e5828dc5106a88323f9a7a701 -g9DqcAkPVA +ebe328a57f3d34708709ca99d3304af1733592d9 +SkL_AS-1Jd diff --git a/public/range b/public/range index ca5401d..f2532e8 100644 --- a/public/range +++ b/public/range @@ -41,7 +41,7 @@ of the data structures we’ve already learned.

- +
package main
 
@@ -128,6 +128,21 @@ the indexes though.

+ + +

range can also iterate over just the keys of a map.

+ + + + +
    for k := range kvs {
+        fmt.Println("key:", k)
+    }
+
+ + + +

range on strings iterates over Unicode code @@ -156,11 +171,13 @@ of the rune and the second the rune itself.

-
$ go run range.go 
+            
$ go run range.go
 sum: 9
 index: 1
 a -> apple
 b -> banana
+key: a
+key: b
 0 103
 1 111