From 0a22fa07d509ac953b3eade489a23d4b9d51ec31 Mon Sep 17 00:00:00 2001 From: Sueun Cho Date: Sat, 11 Jul 2026 10:24:22 -0400 Subject: [PATCH] user: fix swapped file references in error godoc 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 --- user/user.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user/user.go b/user/user.go index 14b0b41..a26ebb9 100644 --- a/user/user.go +++ b/user/user.go @@ -17,9 +17,9 @@ const ( ) var ( - // ErrNoPasswdEntries is returned if no matching entries were found in /etc/group. + // ErrNoPasswdEntries is returned if no matching entries were found in /etc/passwd. ErrNoPasswdEntries = errors.New("no matching entries in passwd file") - // ErrNoGroupEntries is returned if no matching entries were found in /etc/passwd. + // ErrNoGroupEntries is returned if no matching entries were found in /etc/group. ErrNoGroupEntries = errors.New("no matching entries in group file") // ErrRange is returned if a UID or GID is outside of the valid range. ErrRange = fmt.Errorf("uids and gids must be in range %d-%d", minID, maxID)