Closed
Description
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version
)?
go1.10 linux/amd64
Does this issue reproduce with the latest release?
Not sure, though source code still has the issue.
What operating system and processor architecture are you using (go env
)?
linux, amd64
What did you do?
Called user.Lookup from os/user with "speech-dispatcher". Why? It was attempt to manually parse some unrelated file.
You just need to call user.Lookup on a linux with cgo support, so that cgo_lookup_unix.go file will be used.
For some unknown reason, the whole call ends up at line 78, where buildUser is called and error is nil.
package main
import "os/user"
func main() {
u, err := user.Lookup("speech-dispatcher")
if err == nil && u.Username == "speech-dispatcher" { panic("oh, boy!") }
}
What did you expect to see?
UnknownUserError
What did you see instead?
nil