]> Cypherpunks repositories - gostls13.git/commitdiff
doc/codewalk/markov: fix slice error in description
authorRob Pike <r@golang.org>
Mon, 1 Apr 2013 22:52:15 +0000 (15:52 -0700)
committerRob Pike <r@golang.org>
Mon, 1 Apr 2013 22:52:15 +0000 (15:52 -0700)
Fixes #5176.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8118046

doc/codewalk/markov.xml

index 7f12818177553ce0039b5ce1097c56d4a661c08e..76c448ac32a0f1a3dffba647e44290fbe4b05559 100644 (file)
@@ -181,7 +181,7 @@ p == Prefix{"am", "not"}</pre>
        one index to the left (if you consider zero as the leftmost index).
        <pre>
 p := Prefix{"I", "am"}
-copy(p, p[:1])
+copy(p, p[1:])
 // p == Prefix{"am", "am"}</pre>
        We then assign the provided <code>word</code> to the last index
        of the slice: