History

Work around whole file example detection bug

After https://github.com/golang/go/commit/499dc1c5d583a2a0735d4e408078819b84697e2e, Go fails to detect whole file examples, if file is missing non-function declarations.

Gregory Petrosyan committed 6 years ago

Commit d17ccdb1 parent 7d60fe71 file · +2 −0Browse files

Unified · Split

example_function_test.go+2−0
@@ -14,6 +14,8 @@ import ( · 13 unmodified lines
14 "pgregory.net/rapid"14 "pgregory.net/rapid"
15)15)
16 16
17type 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.
18func ParseDate(s string) (int, int, int, error) {20func ParseDate(s string) (int, int, int, error) {
19 if len(s) != 10 {21 if len(s) != 10 {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t