From 477d3b98e5c650e877b858e6c26b9de2ef46341a Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Thu, 14 Apr 2016 09:31:55 +1000 Subject: [PATCH] godoc: recognize examples with unordered output A pared down verison of https://golang.org/cl/20458 that is compatible with Go 1.5. Fixes golang/go#10149 Change-Id: I550b097dc1cd65d0711bdea943f2b0678cfbc5fd Reviewed-on: https://go-review.googlesource.com/22032 Reviewed-by: Caleb Spare Reviewed-by: Andrew Gerrand Run-TryBot: Andrew Gerrand --- godoc/godoc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/godoc/godoc.go b/godoc/godoc.go index dda1f49c..7bb4829a 100644 --- a/godoc/godoc.go +++ b/godoc/godoc.go @@ -587,7 +587,7 @@ func startsWithUppercase(s string) bool { return unicode.IsUpper(r) } -var exampleOutputRx = regexp.MustCompile(`(?i)//[[:space:]]*output:`) +var exampleOutputRx = regexp.MustCompile(`(?i)//[[:space:]]*(unordered )?output:`) // stripExampleSuffix strips lowercase braz in Foo_braz or Foo_Bar_braz from name // while keeping uppercase Braz in Foo_Braz.