diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-03 09:52:19 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-03 09:52:19 +0800 |
commit | defcc9374bffe4730bdd4655f34df559d1aa70b1 (patch) | |
tree | a88577a25e5ea251149d181f301413ed4a867635 /models | |
parent | 0632198a40b7498cee15aba8cf56b0815ccb2e7d (diff) | |
parent | 3f849ddfabbbbf77f66a18e0d88ba97a132f9812 (diff) |
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'models')
-rw-r--r-- | models/publickey.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/models/publickey.go b/models/publickey.go index 86dd50e8..49863d8c 100644 --- a/models/publickey.go +++ b/models/publickey.go @@ -4,9 +4,10 @@ import ( "fmt" "os" "os/exec" - "os/user" "path/filepath" "time" + + "github.com/Unknwon/com" ) var ( @@ -27,11 +28,11 @@ func exePath() (string, error) { } func homeDir() string { - user, err := user.Current() + home, err := com.HomeDir() if err != nil { return "/" } - return user.HomeDir + return home } func init() { @@ -68,7 +69,7 @@ func AddPublicKey(key *PublicKey) error { if err != nil { _, err2 := orm.Delete(key) if err2 != nil { - // TODO: logo the error + // TODO: log the error } return err } |