After https://github.com/golang/go/commit/499dc1c5d583a2a0735d4e408078819b84697e2e, Go fails to detect whole file examples, if file is missing non-function declarations.
Showing the changes to example_function_test.go (1 of 1 file). Show all
Unified · Split
| @@ -14,6 +14,8 @@ import ( · 13 unmodified lines | |||
| 14 | "pgregory.net/rapid" | 14 | "pgregory.net/rapid" |
| 15 | ) | 15 | ) |
| 16 | 16 | ||
| 17 | type goExampleBugWorkaround int // work around whole file example detection bug introduced in Go 1.14 | ||
| 18 | |||
| 17 | // ParseDate parses dates in the YYYY-MM-DD format. | 19 | // ParseDate parses dates in the YYYY-MM-DD format. |
| 18 | func ParseDate(s string) (int, int, int, error) { | 20 | func ParseDate(s string) (int, int, int, error) { |
| 19 | if len(s) != 10 { | 21 | if len(s) != 10 { |