aboutsummaryrefslogtreecommitdiff
path: root/content/generate.article
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2014-12-23 10:09:38 +1100
committerAndrew Gerrand <adg@golang.org>2014-12-22 23:24:04 +0000
commitd100f69676887383f55a1a7fd7aa2680f0fde998 (patch)
tree1f0be57b1ab66c8c961d59eb90214ffadbc7f939 /content/generate.article
parentb35b5e35dbb795b8392180ed8b008a2e245e55cf (diff)
stringer: fix sample generated code
Note to self: never hand-edit generated code. This is the actual output from stringer. Change-Id: I3900b790d2019afa5dc4ed55391d50cd4f772525 Reviewed-on: https://go-review.googlesource.com/1993 Reviewed-by: Andrew Gerrand <adg@golang.org>
Diffstat (limited to 'content/generate.article')
-rw-r--r--content/generate.article2
1 files changed, 1 insertions, 1 deletions
diff --git a/content/generate.article b/content/generate.article
index ea742e1..3d4192e 100644
--- a/content/generate.article
+++ b/content/generate.article
@@ -156,7 +156,7 @@ Let's run it:
var _Pill_index = [...]uint8{0, 7, 14, 23, 34}
func (i Pill) String() string {
- if i < 0 || i >= Pill(len(_Pill_index)) {
+ if i < 0 || i+1 >= Pill(len(_Pill_index)) {
return fmt.Sprintf("Pill(%d)", i)
}
return _Pill_name[_Pill_index[i]:_Pill_index[i+1]]