Work around lack of cgo when cross-compiling to arm.

Change-Id: Ic230362b9f19af0c99f296f14330c970bf5d010b
This commit is contained in:
Brad Fitzpatrick 2013-11-16 22:22:48 -08:00
parent 272db6545a
commit 5ce4fab0f9
1 changed files with 5 additions and 0 deletions

View File

@ -20,11 +20,16 @@ package server
import (
"os/user"
"camlistore.org/pkg/osutil"
)
func getUserName() (string, error) {
u, err := user.Current()
if err != nil {
if v := osutil.Username(); v != "" {
return v, nil
}
return "", err
}
return u.Name, nil