Skip to content

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

@fragglet

Description

@fragglet

Description

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

// if require.NoError(t, err) {

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions