Skip to content

docs: clarify EventuallyWithTf callback vs failure message#1893

Open
leno23 wants to merge 1 commit into
stretchr:masterfrom
leno23:docs/eventually-withtf-1833
Open

docs: clarify EventuallyWithTf callback vs failure message#1893
leno23 wants to merge 1 commit into
stretchr:masterfrom
leno23:docs/eventually-withtf-1833

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

  • Clarify godoc examples for EventuallyWithTf so the condition callback is only func(c *CollectT)
  • Note that msg and args format the timeout failure, not the callback

Fixes #1833

Test plan

  • Comment-only change; no code behavior change

The godoc examples implied format strings belong on the condition
callback. Document that msg/args apply only on timeout.

Fixes stretchr#1833
@leno23 leno23 force-pushed the docs/eventually-withtf-1833 branch from 4d42955 to 2d7c85c Compare May 17, 2026 15:51
Copy link
Copy Markdown
Collaborator

@dolmen dolmen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc changes must be applied in assert/assertions.go, and then run .ci.gogenerate.sh.

// }, 10*time.Second, 1*time.Second, "externalValue was not true before timeout")
//
// The msg and args format the failure when the condition is never met; they are
// not passed to the condition callback.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change must be applied on assertions.go, and then run go generate github.com/stretchr/testify/... to regenerate dependents.

@dolmen dolmen added documentation assert.Eventually About assert.Eventually/EventuallyWithT pkg-assert Change related to package testify/assert pkg-require Change related to package testify/require labels May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

assert.Eventually About assert.Eventually/EventuallyWithT documentation pkg-assert Change related to package testify/assert pkg-require Change related to package testify/require

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EventuallyWithTf function help is incorrect, misleading callback signature

2 participants