Skip to content

all: move all examples to external test packages #11257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
josharian opened this issue Jun 17, 2015 · 3 comments
Closed

all: move all examples to external test packages #11257

josharian opened this issue Jun 17, 2015 · 3 comments
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge
Milestone

Comments

@josharian
Copy link
Contributor

This is an extraction from #11254.

Having the package prefix in examples is clearer than omitting it. Since examples must not make use of unexported functionality anyway, it is always ok to have them in an external test package. Let's move all examples to external test packages.

If Go 1 compatibility didn't prevent it, I'd suggest that we modify the testing package to enforce this.

@josharian josharian added this to the Go1.6 milestone Jun 17, 2015
@josharian josharian added the Documentation Issues describing a change to documentation. label Jun 17, 2015
@josharian
Copy link
Contributor Author

Filed golang/lint#135 to add a lint check for this.

@josharian josharian modified the milestones: Go1.6, Go1.6Early Jun 29, 2015
@adg
Copy link
Contributor

adg commented Aug 22, 2015

I could only find one such set of examples, in package mime. CL incoming.

My command line for finding them is:

grep '^package' $(git grep -l '^func Example') | grep -v '_test$'

@adg adg self-assigned this Aug 22, 2015
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/13779 mentions this issue.

@adg adg closed this as completed in 8ca7856 Aug 22, 2015
@golang golang locked and limited conversation to collaborators Aug 22, 2016
@rsc rsc unassigned adg Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

3 participants