Skip to content

require: fix godoc generation for assertions returning a bool#1850

Merged
dolmen merged 1 commit intostretchr:masterfrom
Baxromumarov:fix-require-doc-generation
Feb 17, 2026
Merged

require: fix godoc generation for assertions returning a bool#1850
dolmen merged 1 commit intostretchr:masterfrom
Baxromumarov:fix-require-doc-generation

Conversation

@Baxromumarov
Copy link

@Baxromumarov Baxromumarov commented Feb 14, 2026

Summary

The doc comments for multiple functions in the require package have code examples that are invalid. Example, function doesn't return anything but in the comment it says it return bool value:

testify/require/require.go

Lines 1391 to 1394 in 3f28143

// if require.NoError(t, err) {
// require.Equal(t, expectedObj, actualObj)
// }
func NoError(t TestingT, err error, msgAndArgs ...interface{}) {

Changes

Changed require.go.tmpl, require_forward.go.tmpl added new generator for them

Motivation

There was a related issue, and the misleading comments needed to be fixed
Issue #1776

@Baxromumarov Baxromumarov changed the title fix require doc generator #1776 fix require doc generator Feb 14, 2026
@dolmen dolmen changed the title fix require doc generator require: fix godoc generation for assertions returning a bool Feb 17, 2026
@dolmen dolmen added documentation pkg-require Change related to package testify/require internal/codegen Change related to internal code generation labels Feb 17, 2026
@dolmen
Copy link
Collaborator

dolmen commented Feb 17, 2026

@Baxromumarov Please fix the commit message to "require: fix godoc generation for assertions returning a bool"

@Baxromumarov Baxromumarov force-pushed the fix-require-doc-generation branch from da09cf4 to 43f6438 Compare February 17, 2026 12:05
@Baxromumarov
Copy link
Author

@Baxromumarov Please fix the commit message to "require: fix godoc generation for assertions returning a bool"

@dolmen
done

@Baxromumarov
Copy link
Author

@dolmen i don't have access to merge, if my changes are ok please merge it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation internal/codegen Change related to internal code generation pkg-require Change related to package testify/require

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants