stretchr/testify

require: invalid examples from doc comments as functions don't return bool

Open

#1,776 opened on 2025年8月4日

GitHub で見る
 (8 comments) (1 reaction) (1 assignee)Go (1,704 forks)batch import
bugdocumentationgood first issue

Repository metrics

Stars
 (25,958 stars)
PR merge metrics
 (平均マージ 6d 15h) (30d で 2 merged PRs)

説明

Description

The doc comments for multiple functions in the require package have code examples that are invalid. Example:

https://github.com/stretchr/testify/blob/a53be35c3b0cfcd5189cffcfd75df60ea581104c/require/require.go#L1391

The example reads:

	  if require.NoError(t, err) {
		   require.Equal(t, expectedObj, actualObj)
	  }

but the NoError() function does not return any value, so this is invalid.

There are similar invalid examples in the doc comments for NoErrorf, NotEmpty and NotEmptyf.

コントリビューターガイド