From 94cba6875def0ffc8dbed05dff434c1bf87d35b0 Mon Sep 17 00:00:00 2001 From: Mark McGranaghan Date: Tue, 27 Dec 2016 08:50:13 -0800 Subject: [PATCH] Add some inline links to "previous examples" Fixes #144. --- examples/mutexes/mutexes.go | 4 ++-- examples/mutexes/mutexes.hash | 4 ++-- examples/stateful-goroutines/stateful-goroutines.go | 4 ++-- examples/stateful-goroutines/stateful-goroutines.hash | 4 ++-- public/mutexes | 6 +++--- public/stateful-goroutines | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/mutexes/mutexes.go b/examples/mutexes/mutexes.go index e0b68d0..f054494 100644 --- a/examples/mutexes/mutexes.go +++ b/examples/mutexes/mutexes.go @@ -1,6 +1,6 @@ // In the previous example we saw how to manage simple -// counter state using atomic operations. For more complex -// state we can use a _[mutex](http://en.wikipedia.org/wiki/Mutual_exclusion)_ +// counter state using [atomic operations](atomic-counters). +// For more complex state we can use a _[mutex](http://en.wikipedia.org/wiki/Mutual_exclusion)_ // to safely access data across multiple goroutines. package main diff --git a/examples/mutexes/mutexes.hash b/examples/mutexes/mutexes.hash index 221d44d..79fd377 100644 --- a/examples/mutexes/mutexes.hash +++ b/examples/mutexes/mutexes.hash @@ -1,2 +1,2 @@ -a42e6b574ab2c2bdd38df53d77b9a2f3f3e0b10c --_LKNceBru +3ce8467418aa740ea6c930afac3985a943c76311 +kZrod-Rkos diff --git a/examples/stateful-goroutines/stateful-goroutines.go b/examples/stateful-goroutines/stateful-goroutines.go index 6dce32b..0251aa5 100644 --- a/examples/stateful-goroutines/stateful-goroutines.go +++ b/examples/stateful-goroutines/stateful-goroutines.go @@ -1,6 +1,6 @@ // In the previous example we used explicit locking with -// mutexes to synchronize access to shared state across -// multiple goroutines. Another option is to use the +// [mutexes](mutexes) to synchronize access to shared state +// across multiple goroutines. Another option is to use the // built-in synchronization features of goroutines and // channels to achieve the same result. This channel-based // approach aligns with Go's ideas of sharing memory by diff --git a/examples/stateful-goroutines/stateful-goroutines.hash b/examples/stateful-goroutines/stateful-goroutines.hash index 91c1719..43724f4 100644 --- a/examples/stateful-goroutines/stateful-goroutines.hash +++ b/examples/stateful-goroutines/stateful-goroutines.hash @@ -1,2 +1,2 @@ -9b7362872b9984296fd919441c2b6928ae0d70c1 -qHTT2jOKkS +603a70a77ed18db9da4f8c7911a92b87fd21400c +-WqmiTr6ek diff --git a/public/mutexes b/public/mutexes index 2f89840..f145c31 100644 --- a/public/mutexes +++ b/public/mutexes @@ -26,8 +26,8 @@

In the previous example we saw how to manage simple -counter state using atomic operations. For more complex -state we can use a mutex +counter state using atomic operations. +For more complex state we can use a mutex to safely access data across multiple goroutines.

@@ -42,7 +42,7 @@ to safely access data across multiple goroutines.

- +
package main
 
diff --git a/public/stateful-goroutines b/public/stateful-goroutines index 2a73ec8..6f6523f 100644 --- a/public/stateful-goroutines +++ b/public/stateful-goroutines @@ -26,8 +26,8 @@

In the previous example we used explicit locking with -mutexes to synchronize access to shared state across -multiple goroutines. Another option is to use the +mutexes to synchronize access to shared state +across multiple goroutines. Another option is to use the built-in synchronization features of goroutines and channels to achieve the same result. This channel-based approach aligns with Go’s ideas of sharing memory by @@ -46,7 +46,7 @@ by exactly 1 goroutine.

- +
package main