talks: State of Go May 2017

Change-Id: I1736e8e61137cb4b3c59870503e65635762bab19
Reviewed-on: https://go-review.googlesource.com/43553
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/2017/state-of-go-may.slide b/2017/state-of-go-may.slide
new file mode 100644
index 0000000..2a75d49
--- /dev/null
+++ b/2017/state-of-go-may.slide
@@ -0,0 +1,299 @@
+The State of Go
+Where we are in May 2017
+
+Francesc Campoy
+Google Developer Advocate
+@francesc
+campoy@golang.org
+
+* Time flies
+
+Go 1.7 is already 9 months old!
+
+Go 1.8 was released on February 16th.
+
+On May 1st we entered the release freeze for Go 1.9
+
+Go 1.9 will be released early August.
+
+.image state-of-go-may/img/flying.png
+
+* Notes
+
+The slides are available on [[https://talks.golang.org/2017/state-of-go-may.slide]]
+
+Most of the code examples won't run except locally and using tip.
+
+The playground runs Go 1.8.
+
+* Agenda
+
+Changes since Go 1.8:
+
+- The Language
+- The Standard Library
+- The Runtime
+- The Tooling
+- The Community
+
+* Changes to the language
+
+* Codebase Refactoring (with help from Go)
+
+Article written by Russ Cox [[https://talks.golang.org/2016/refactor.article][link]]
+
+.image state-of-go-may/img/atomic.svg _ 300
+
+* Gradual Code Repair
+
+In reality, atomically changing all usages of an API is often impossible.
+
+.image state-of-go-may/img/gradual.svg _ 600
+
+* An example
+
+Imagine we created a new package `net/http/status`.
+
+First: create the new API
+
+    package status
+
+    const OK = http.StatusOK
+
+Second: change each usage of `http.StatusOK` by `status.OK`.
+
+    if res.StatusCode != http.StatusOK {
+    
+    if res.StatusCode != status.OK {
+
+Third: remove the old API
+
+* Another example
+
+Let's rename `http.Get` to `http.DoGetPleaseAndThanks`.
+
+First: create the new API
+
+    func DoGetPleaseAndThanks(url string) (*http.Response, error) {
+        return Get(url)
+    }
+
+Second: change each usage of `http.Get` to `http.DoGetPleaseAndThanks`.
+
+    res, err := http.Get("https://golang.org")
+    
+    res, err := http.DoGetPleaseAndThanks("https://golang.org")
+
+Third: remove the old API
+
+* One last example
+
+Let's move `http.Client` to `http.Applicant`.
+
+First: create the new API
+
+    type Applicant Client
+
+- `Applicant` has no methods.
+- Both types are convertible.
+
+    type Applicant struct { Client }
+
+- `Applicant` has all the methods of `Client`
+- The types are not convertible.
+
+* Alias declarations
+
+An alias declaration is a new kind of type declaration.
+
+    type Applicant = http.Client
+
+Both types are equivalent and completely interchangeable.
+
+- type conversion is not needed
+- can't declare methods on the alias declaration
+
+.play state-of-go-may/alias/main.go /type/,
+
+
+* Quaternions
+
+.image state-of-go-may/img/quaternions.png _ 750
+.caption [[https://golang.org/issue/19813][issue #19813]]
+
+* The Standard library
+
+* A Twitter Poll
+
+.image state-of-go-may/img/twitter-poll.png _ 800
+.caption [[https://twitter.com/francesc/status/863514399486623744][twitter poll]]
+
+* math/bits
+
+[[https://tip.golang.org/pkg/math/bits/#Len16][Package bits]] implements bit counting and manipulation functions for the predeclared unsigned integer types.
+
+Added to the standard library with proposal [[https://golang.org/issue/18616][#18616]].
+
+- LenXX, OnesCountXX
+- ReverseXX, ReverseBytesXX
+- RotateLeftXX
+- LeadingZerosXX, TrailingZerosXX
+
+.play state-of-go-may/bits/main.go /START/,/END/
+
+* sync.Map
+
+A new type has been added to the `sync` package with proposal [[https://golang.org/issue/18177][#18177]].
+
+[[https://tip.golang.org/pkg/sync/#Map][sync.Map]] is a concurrent map with amortized-constant-time loads, stores,and deletes.
+
+- the zero map is valid
+- it must not be copied (use pointers)
+
+* sync.Map code sample
+
+.play state-of-go-may/syncmap/main.go /func main/,
+
+* html/template panic on predefined escaper
+
+What do you expect [[https://play.golang.org/p/-z5rZilH1F][this code]] to print?
+
+.play state-of-go-may/html/main.go /Foo/,
+
+Predefined escapers in `html` template create a security concern.
+
+Since 1.9 `Execute` will panic.
+
+* os.Exec
+
+Let's imagine that we have a command `getenv` that prints an environment variable
+using `os.Getenv`.
+
+.code state-of-go-may/exec/getenv/main.go /func main/,
+
+We can run it as follows:
+
+    $ foo=bar getenv foo
+    bar
+
+* os.Exec
+
+What do you expect this code to print?
+
+.code state-of-go-may/exec/main.go /func main/,
+
+bar, or newbar?
+
+* another Twitter poll
+
+.image state-of-go-may/img/exec-poll.png _ 600
+.caption [[https://twitter.com/francesc/status/863791506934472705][Twitter poll]]
+
+* os.Exec
+
+`Cmd.Start` now removes duplicates of environment variables, keeping the last one.
+
+This code does what one expects:
+
+    cmd := exec.Command("prog")
+    cmd.Env = append(os.Environ(), "FOO=bar")
+
+* The Runtime
+
+* Benchmarks
+
+.image state-of-go-may/img/benchmark.png _ 800
+.caption _note_: values over 1.0 mean tip is faster
+.caption _note_: unofficial benchmark ran on my laptop while playing YouTube videos
+
+* More runtime
+
+Garbage Collector
+
+- New algorithm for large object allocation
+- Better performance and increased determinism for large (+50GB) heaps
+
+[[https://en.wikipedia.org/wiki/DWARF][DWARF]]
+
+- Ongoing effort to improve the generated DWARF information.
+- This will help debuggers, among other tools.
+
+* The Tooling
+
+* go compiler: better errors!
+
+Better error messaging for Allman style braces.
+
+    package main
+
+    func main()
+    {
+        fmt.Println("that ain't gonna compile")
+    }
+
+With go 1.8:
+
+    fail/main.go:4: syntax error: unexpected semicolon or newline before {
+
+With go 1.9:
+
+    fail/main.go:3:6: missing function body for "main"
+    fail/main.go:4:1: syntax error: unexpected semicolon or newline before {
+
+* go compiler: more modular and faster
+
+The compiler has been refactored into multiple packages.
+
+    cmd/go/internal/...
+
+Issue [[https://golang.org/issue/17639][#17639]] made parsing concurrent.
+
+The compiler is faster as a result.
+
+* go test
+
+`vendor` directories are ignored by the `go` tool [[https://golang.org/issue/19090][#19090]]:
+
+    go test ./...
+
+You can now list all the tests to be executed, without running them [[https://golang.org/issue/17209][#17209]].
+
+	$ go test -test.list .
+    TestIntegration
+    TestEmbedStreams
+    TestEmbedFiles
+
+* godoc
+
+You can now link to fields in a struct in the documentation [[https://golang.org/issue/16753][#16753]].
+
+.link https://tip.golang.org/pkg/net/http/#Client.Transport
+
+_Note_: This was actually introduced with Go 1.8!
+
+* ... and much more!
+
+* The community
+
+* Go meetups
+
+.image state-of-go-may/img/meetups.png _ 900
+.caption Gophers all around the world! [[http://go-meetups.appspot.com]]
+
+* Women Who Go
+
+.image state-of-go-may/img/wwg.png _ 800
+.caption 19 chapters already! [[http://www.womenwhogo.org]]
+
+* Women Who Go Gophercon Scholarship
+
+WWG is sponsoring minority gophers from all over the world to attend Gophercon
+
+.image state-of-go-may/img/wwg-logo.png _ 700
+
+* Conferences:
+
+- [[http://gophercon.sg][Gophercon Singapore]], May 25-26th
+- [[https://gophercon.com/][Gophercon Denver]], Jul 12-15th
+- [[http://golanguk.com/][Golang UK]], August 16th-18th
+- [[http://2017.dotgo.eu/][dotGo]], Nov 6th
\ No newline at end of file
diff --git a/2017/state-of-go-may/alias/main.go b/2017/state-of-go-may/alias/main.go
new file mode 100644
index 0000000..ddc386e
--- /dev/null
+++ b/2017/state-of-go-may/alias/main.go
@@ -0,0 +1,12 @@
+package main
+
+import (
+	"fmt"
+	"net/http"
+)
+
+type Applicant = http.Client
+
+func main() {
+	fmt.Printf("%T", Applicant{})
+}
diff --git a/2017/state-of-go-may/bits/main.go b/2017/state-of-go-may/bits/main.go
new file mode 100644
index 0000000..ad3ca08
--- /dev/null
+++ b/2017/state-of-go-may/bits/main.go
@@ -0,0 +1,17 @@
+package main
+
+import (
+	"fmt"
+	"math/bits"
+)
+
+func main() {
+	const n = 100
+	// START OMIT
+	fmt.Printf("%d (%b) has %d bits set to one\n", n, n, bits.OnesCount(n))
+
+	fmt.Printf("%d reversed is %d\n", n, bits.Reverse(n))
+
+	fmt.Printf("%d can be encoded in %d bits\n", n, bits.Len(n))
+	// END OMIT
+}
diff --git a/2017/state-of-go-may/exec/getenv/main.go b/2017/state-of-go-may/exec/getenv/main.go
new file mode 100644
index 0000000..08e6492
--- /dev/null
+++ b/2017/state-of-go-may/exec/getenv/main.go
@@ -0,0 +1,14 @@
+package main
+
+import (
+	"fmt"
+	"os"
+)
+
+func main() {
+	if len(os.Args) != 2 {
+		fmt.Printf("use %s varname\n", os.Args[0])
+		os.Exit(1)
+	}
+	fmt.Println(os.Getenv(os.Args[1]))
+}
diff --git a/2017/state-of-go-may/exec/main.go b/2017/state-of-go-may/exec/main.go
new file mode 100644
index 0000000..dced1d3
--- /dev/null
+++ b/2017/state-of-go-may/exec/main.go
@@ -0,0 +1,17 @@
+package main
+
+import (
+	"log"
+	"os"
+	"os/exec"
+)
+
+func main() {
+	cmd := exec.Command("getenv", "foo")
+	cmd.Env = append(os.Environ(), "foo=newbar") // HL
+	cmd.Stdout = os.Stdout
+	cmd.Stderr = os.Stderr
+	if err := cmd.Run(); err != nil {
+		log.Fatal(err)
+	}
+}
diff --git a/2017/state-of-go-may/html/main.go b/2017/state-of-go-may/html/main.go
new file mode 100644
index 0000000..3668a66
--- /dev/null
+++ b/2017/state-of-go-may/html/main.go
@@ -0,0 +1,23 @@
+package main
+
+import (
+	"html/template"
+	"log"
+	"os"
+)
+
+type Foo struct{ Bar string }
+
+func main() {
+	tmpl, err := template.New("home").Parse(`
+		<a title={{.Bar | html}}>
+	`)
+	if err != nil {
+		log.Fatalf("could not parse: %v", err)
+	}
+
+	foo := Foo{"haha onclick=evil()"}
+	if err := tmpl.Execute(os.Stdout, foo); err != nil {
+		log.Fatalf("could not execute: %v", err)
+	}
+}
diff --git a/2017/state-of-go-may/img/atomic.svg b/2017/state-of-go-may/img/atomic.svg
new file mode 100644
index 0000000..244fe37
--- /dev/null
+++ b/2017/state-of-go-may/img/atomic.svg
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="-1 -1 124 82" width="124pt" height="82pt" xmlns:dc="http://purl.org/dc/elements/1.1/">
+  <metadata> Produced by OmniGraffle 7.2.1 
+    <dc:date>2016-12-01 03:28:54 +0000</dc:date>
+  </metadata>
+  <defs>
+    <font-face font-family="Arial" font-size="12" panose-1="2 11 6 4 2 2 2 2 2 4" units-per-em="1000" underline-position="-105.95703" underline-thickness="73.24219" slope="0" x-height="518.5547" cap-height="716.3086" ascent="905.2734" descent="-211.91406" font-weight="500">
+      <font-face-src>
+        <font-face-name name="ArialMT"/>
+      </font-face-src>
+    </font-face>
+  </defs>
+  <g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1">
+    <title>Canvas 1</title>
+    <g>
+      <title>Layer 1</title>
+      <text transform="translate(17.125 4.411133)" fill="black">
+        <tspan font-family="Arial" font-size="12" font-weight="500" x="9.143555" y="11" textLength="50.033203">Add new </tspan>
+        <tspan font-family="Arial" font-size="12" font-weight="500" x="58.51465" y="11" textLength="19.341797">API</tspan>
+        <tspan font-family="Arial" font-size="12" font-weight="500" x="9.149414" y="39.39258" textLength="68.70117">Code repairs</tspan>
+        <tspan font-family="Arial" font-size="12" font-weight="500" x=".47753906" y="67.78516" textLength="67.365234">Remove old </tspan>
+        <tspan font-family="Arial" font-size="12" font-weight="500" x="67.180664" y="67.78516" textLength="19.341797">API</tspan>
+      </text>
+      <path d="M 18.1875 7105427e-21 L 103.0625 7105427e-21 C 113.102 7105427e-21 121.25 17.92 121.25 40 C 121.25 62.08 113.102 80 103.0625 80 L 18.1875 80 C 8.148 80 0 62.08 0 40 C 0 17.92 8.148 7105427e-21 18.1875 7105427e-21" stroke="#ff2600" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+    </g>
+  </g>
+</svg>
diff --git a/2017/state-of-go-may/img/benchmark.png b/2017/state-of-go-may/img/benchmark.png
new file mode 100644
index 0000000..a8f4c5d
--- /dev/null
+++ b/2017/state-of-go-may/img/benchmark.png
Binary files differ
diff --git a/2017/state-of-go-may/img/exec-poll.png b/2017/state-of-go-may/img/exec-poll.png
new file mode 100644
index 0000000..6dc0ef0
--- /dev/null
+++ b/2017/state-of-go-may/img/exec-poll.png
Binary files differ
diff --git a/2017/state-of-go-may/img/flying.png b/2017/state-of-go-may/img/flying.png
new file mode 100644
index 0000000..7157563
--- /dev/null
+++ b/2017/state-of-go-may/img/flying.png
Binary files differ
diff --git a/2017/state-of-go-may/img/gradual.svg b/2017/state-of-go-may/img/gradual.svg
new file mode 100644
index 0000000..d0caccb
--- /dev/null
+++ b/2017/state-of-go-may/img/gradual.svg
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="-2 -1 305 178" width="305pt" height="178pt" xmlns:dc="http://purl.org/dc/elements/1.1/">
+  <metadata> Produced by OmniGraffle 7.2.1 
+    <dc:date>2016-12-01 03:27:43 +0000</dc:date>
+  </metadata>
+  <defs>
+    <font-face font-family="Arial" font-size="12" panose-1="2 11 6 4 2 2 2 2 2 4" units-per-em="1000" underline-position="-105.95703" underline-thickness="73.24219" slope="0" x-height="518.5547" cap-height="716.3086" ascent="905.2734" descent="-211.91406" font-weight="500">
+      <font-face-src>
+        <font-face-name name="ArialMT"/>
+      </font-face-src>
+    </font-face>
+    <font-face font-family="Arial" font-size="10" panose-1="2 11 6 4 2 2 2 2 2 4" units-per-em="1000" underline-position="-105.95703" underline-thickness="73.24219" slope="0" x-height="518.5547" cap-height="716.3086" ascent="905.2734" descent="-211.91406" font-weight="500">
+      <font-face-src>
+        <font-face-name name="ArialMT"/>
+      </font-face-src>
+    </font-face>
+  </defs>
+  <g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1">
+    <title>Canvas 1</title>
+    <g>
+      <title>Layer 1</title>
+      <path d="M 107.86806 0 L 192.9375 0 C 203 0 211.16667 5.0524444 211.16667 11.277778 C 211.16667 17.503111 203 22.555556 192.9375 22.555556 L 107.86806 22.555556 C 97.80556 22.555556 89.63889 17.503111 89.63889 11.277778 C 89.63889 5.0524444 97.80556 0 107.86806 0" stroke="#0432ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+      <text transform="translate(106.79167 4.0814887)" fill="black">
+        <tspan font-family="Arial" font-size="12" font-weight="500" fill="black" x="9.254666" y="11" textLength="50.033203">Add new </tspan>
+        <tspan font-family="Arial" font-size="12" font-weight="500" fill="black" x="58.62576" y="11" textLength="19.341797">API</tspan>
+      </text>
+      <path d="M 107.86806 38.11111 L 192.9375 38.11111 C 203 38.11111 211.16667 43.163556 211.16667 49.38889 C 211.16667 55.61422 203 60.66667 192.9375 60.66667 L 107.86806 60.66667 C 97.80556 60.66667 89.63889 55.61422 89.63889 49.38889 C 89.63889 43.163556 97.80556 38.11111 107.86806 38.11111" stroke="#0432ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+      <text transform="translate(106.79167 42.1926)" fill="black">
+        <tspan font-family="Arial" font-size="12" font-weight="500" fill="black" x="9.260525" y="11" textLength="68.70117">Code repairs</tspan>
+      </text>
+      <path d="M 184.09028 76.22222 L 269.15972 76.22222 C 279.22222 76.22222 287.3889 81.27467 287.3889 87.5 C 287.3889 93.72533 279.22222 98.77778 269.15972 98.77778 L 184.09028 98.77778 C 174.02778 98.77778 165.86111 93.72533 165.86111 87.5 C 165.86111 81.27467 174.02778 76.22222 184.09028 76.22222" stroke="#0432ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+      <text transform="translate(183.01389 80.30371)" fill="black">
+        <tspan font-family="Arial" font-size="12" font-weight="500" x="9.260525" y="11" textLength="68.70117">Code repairs</tspan>
+      </text>
+      <path d="M 30.868056 76.22222 L 115.9375 76.22222 C 126 76.22222 134.16667 81.27467 134.16667 87.5 C 134.16667 93.72533 126 98.77778 115.9375 98.77778 L 30.868056 98.77778 C 20.805556 98.77778 12.638889 93.72533 12.638889 87.5 C 12.638889 81.27467 20.805556 76.22222 30.868056 76.22222" stroke="#0432ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+      <text transform="translate(29.791667 80.30371)" fill="black">
+        <tspan font-family="Arial" font-size="12" font-weight="500" x="9.260525" y="11" textLength="68.70117">Code repairs</tspan>
+      </text>
+      <path d="M 107.86806 114.33333 L 192.9375 114.33333 C 203 114.33333 211.16667 119.38578 211.16667 125.61111 C 211.16667 131.83644 203 136.88889 192.9375 136.88889 L 107.86806 136.88889 C 97.80556 136.88889 89.63889 131.83644 89.63889 125.61111 C 89.63889 119.38578 97.80556 114.33333 107.86806 114.33333" stroke="#0432ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+      <text transform="translate(106.79167 118.41482)" fill="black">
+        <tspan font-family="Arial" font-size="12" font-weight="500" x="9.260525" y="11" textLength="68.70117">Code repairs</tspan>
+      </text>
+      <path d="M 102.67639 152.66667 L 198.12917 152.66667 C 209.41987 152.66667 218.58333 157.71911 218.58333 163.94444 C 218.58333 170.16978 209.41987 175.22222 198.12917 175.22222 L 102.67639 175.22222 C 91.38569 175.22222 82.22222 170.16978 82.22222 163.94444 C 82.22222 157.71911 91.38569 152.66667 102.67639 152.66667" stroke="#ff2600" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+      <text transform="translate(100.85833 156.74816)" fill="black">
+        <tspan font-family="Arial" font-size="12" font-weight="500" fill="black" x="6.5219835" y="11" textLength="67.365234">Remove old </tspan>
+        <tspan font-family="Arial" font-size="12" font-weight="500" fill="black" x="73.22511" y="11" textLength="19.341797">API</tspan>
+      </text>
+      <line x1="36948222e-20" y1="29.555556" x2="300.41667" y2="29.555556" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
+      <line x1="36948222e-20" y1="144.27778" x2="300.41667" y2="144.27778" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
+      <text transform="translate(5 2.8919813)" fill="black">
+        <tspan font-family="Arial" font-size="10" font-weight="500" x="11.985894" y="9" textLength="34.472656">Stage 1</tspan>
+      </text>
+      <text transform="translate(5 40.225315)" fill="black">
+        <tspan font-family="Arial" font-size="10" font-weight="500" x="11.985894" y="9" textLength="34.472656">Stage 2</tspan>
+      </text>
+      <text transform="translate(5 155.33643)" fill="black">
+        <tspan font-family="Arial" font-size="10" font-weight="500" x="11.985894" y="9" textLength="34.472656">Stage 3</tspan>
+      </text>
+    </g>
+  </g>
+</svg>
diff --git a/2017/state-of-go-may/img/meetups.png b/2017/state-of-go-may/img/meetups.png
new file mode 100644
index 0000000..a868c17
--- /dev/null
+++ b/2017/state-of-go-may/img/meetups.png
Binary files differ
diff --git a/2017/state-of-go-may/img/quaternions.png b/2017/state-of-go-may/img/quaternions.png
new file mode 100644
index 0000000..875ec32
--- /dev/null
+++ b/2017/state-of-go-may/img/quaternions.png
Binary files differ
diff --git a/2017/state-of-go-may/img/twitter-poll.png b/2017/state-of-go-may/img/twitter-poll.png
new file mode 100644
index 0000000..a3cca39
--- /dev/null
+++ b/2017/state-of-go-may/img/twitter-poll.png
Binary files differ
diff --git a/2017/state-of-go-may/img/wwg-logo.png b/2017/state-of-go-may/img/wwg-logo.png
new file mode 100644
index 0000000..613c1e0
--- /dev/null
+++ b/2017/state-of-go-may/img/wwg-logo.png
Binary files differ
diff --git a/2017/state-of-go-may/img/wwg.png b/2017/state-of-go-may/img/wwg.png
new file mode 100644
index 0000000..a86fbd2
--- /dev/null
+++ b/2017/state-of-go-may/img/wwg.png
Binary files differ
diff --git a/2017/state-of-go-may/syncmap/main.go b/2017/state-of-go-may/syncmap/main.go
new file mode 100644
index 0000000..aeccb68
--- /dev/null
+++ b/2017/state-of-go-may/syncmap/main.go
@@ -0,0 +1,28 @@
+package main
+
+import (
+	"fmt"
+	"sync"
+	"time"
+)
+
+func main() {
+	var m sync.Map
+
+	for i := 0; i < 3; i++ {
+		go func(i int) {
+			for j := 0; ; j++ {
+				m.Store(i, j)
+			}
+		}(i)
+	}
+
+	for i := 0; i < 10; i++ {
+		m.Range(func(key, value interface{}) bool {
+			fmt.Printf("%d: %d\t", key, value)
+			return true
+		})
+		fmt.Println()
+		time.Sleep(time.Second)
+	}
+}