Let me start off by saying that I don't think this is a bug in the package, but I'm hoping you might have an idea on why I'm getting both a nil credential and a nil error coming back. I've traced it to unexpected results in sysCredRead where the wrapped system call is returning 1 (indicating success), yet pcred remains nil. Unsurprisingly this unexpected output causes invalid output up the chain of calls and panics if a nil error is presumed to mean the credential pointer is valid. The only at all atypical thing I'm doing is calling it from within CGo, but I can't see any reason why that should make a difference.