summaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/lib/pq/user_posix.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-07-12 14:56:44 -0800
committer=Corey Hulen <corey@hulen.com>2015-07-12 14:56:44 -0800
commit1c493317857e729597bb59fc0878b49106257582 (patch)
tree9c69d95de082e22279b30d66034e20cb1e9875c3 /Godeps/_workspace/src/github.com/lib/pq/user_posix.go
parent95b9f872882b367556ca2330eea8c8309db542e6 (diff)
downloadchat-1c493317857e729597bb59fc0878b49106257582.tar.gz
chat-1c493317857e729597bb59fc0878b49106257582.tar.bz2
chat-1c493317857e729597bb59fc0878b49106257582.zip
Fixes mm-1420 adding postgres support
Diffstat (limited to 'Godeps/_workspace/src/github.com/lib/pq/user_posix.go')
-rw-r--r--Godeps/_workspace/src/github.com/lib/pq/user_posix.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/Godeps/_workspace/src/github.com/lib/pq/user_posix.go b/Godeps/_workspace/src/github.com/lib/pq/user_posix.go
new file mode 100644
index 000000000..e937d7d08
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/lib/pq/user_posix.go
@@ -0,0 +1,24 @@
+// Package pq is a pure Go Postgres driver for the database/sql package.
+
+// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris
+
+package pq
+
+import (
+ "os"
+ "os/user"
+)
+
+func userCurrent() (string, error) {
+ u, err := user.Current()
+ if err == nil {
+ return u.Username, nil
+ }
+
+ name := os.Getenv("USER")
+ if name != "" {
+ return name, nil
+ }
+
+ return "", ErrCouldNotDetectUsername
+}