Skip to content
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

cmd/go: count flag has no effect on Examples #42936

Closed
cherrymui opened this issue Dec 2, 2020 · 3 comments
Closed

cmd/go: count flag has no effect on Examples #42936

cherrymui opened this issue Dec 2, 2020 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@cherrymui
Copy link
Member

What version of Go are you using (go version)?

tip (73e796c)

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

darwin/amd64

What did you do?

Running Example with -count flag.

$ go test -run=TestSprintf -count=2 -v fmt
=== RUN   TestSprintf
--- PASS: TestSprintf (0.00s)
=== RUN   TestSprintf
--- PASS: TestSprintf (0.00s)
PASS
ok  	fmt	0.063s
$ go test -run=ExampleSprintf -count=2 -v fmt
=== RUN   ExampleSprintf
--- PASS: ExampleSprintf (0.00s)
PASS
ok  	fmt	0.065s

What did you expect to see?

Example runs N times with -count=N, same as running Tests.

What did you see instead?

Example runs only once.

Sorry if this has discussed before or if a decision has been made.

@cagedmantis cagedmantis changed the title testing: -count flag has no effect on Example? cmd/go: count flag has no effect on Examples Dec 8, 2020
@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 8, 2020
@cagedmantis cagedmantis added this to the Backlog milestone Dec 8, 2020
@cagedmantis
Copy link
Contributor

The test command flag description states that examples are always run once. The maintainers should be able to discuss this further.

@cagedmantis
Copy link
Contributor

/cc @bcmills @jayconrod @matloob

@cherrymui
Copy link
Member Author

Thanks. If this is intended, it is fine. We can close this.

@golang golang locked and limited conversation to collaborators Dec 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants
@cagedmantis @gopherbot @cherrymui and others