Skip to content

user: fix swapped file references in error godoc#233

Merged
thaJeztah merged 1 commit into
moby:mainfrom
sueun-dev:fix-user-error-godoc
Jul 18, 2026
Merged

user: fix swapped file references in error godoc#233
thaJeztah merged 1 commit into
moby:mainfrom
sueun-dev:fix-user-error-godoc

Conversation

@sueun-dev

Copy link
Copy Markdown
Contributor

The doc comments on ErrNoPasswdEntries and ErrNoGroupEntries are swapped. ErrNoPasswdEntries ("no matching entries in passwd file", returned from LookupUser/LookupUid and GetExecUser's user lookup) is documented as /etc/group, and ErrNoGroupEntries ("no matching entries in group file", returned from LookupGroup/LookupGid and GetExecUser's group lookup) is documented as /etc/passwd. Each comment names the other file.

The variable name, error message, and every usage agree; only the comment is wrong, and since these are exported errors the incorrect text shows up in godoc. This swaps the two references so each comment matches its variable.

ErrNoPasswdEntries and ErrNoGroupEntries had their doc comments swapped:
ErrNoPasswdEntries ("no matching entries in passwd file", returned from
LookupUser/LookupUid and GetExecUser's user lookup) was documented as
/etc/group, and ErrNoGroupEntries ("no matching entries in group file",
returned from LookupGroup/LookupGid and GetExecUser's group lookup) was
documented as /etc/passwd. The variable name, error message, and every
usage agree; only the comment was wrong. Swap the two references so each
comment matches its variable.

Signed-off-by: Sueun Cho <sueun.dev@gmail.com>

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thx!

@thaJeztah
thaJeztah merged commit 4f6f431 into moby:main Jul 18, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants