Add unit test to check wrong uid case

This commit is contained in:
Guillaume J. Charmes
2013-07-15 10:05:09 -07:00
parent eb38750d99
commit e41507bde2
2 changed files with 20 additions and 0 deletions
+3
View File
@@ -702,6 +702,9 @@ func ParseRepositoryTag(repos string) (string, string) {
return repos, ""
}
// UserLookup check if the given username or uid is present in /etc/passwd
// and returns the user struct.
// If the username is not found, an error is returned.
func UserLookup(uid string) (*user.User, error) {
file, err := ioutil.ReadFile("/etc/passwd")
if err != nil {