diff options
author | Corey Hulen <corey@hulen.com> | 2015-07-23 11:21:54 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-07-23 11:21:54 -0800 |
commit | b813234f4cc38e72bb94556d3a4acdcde5071468 (patch) | |
tree | f9a0eb8f9596c91531c6997617b4dd66e05dd317 /Godeps/_workspace/src/github.com/lib/pq/user_posix.go | |
parent | 32e8dddd0cd8532e45f89290a154d5d7911c16dd (diff) | |
parent | 98751a4f65a656839dc3724e72e672b585cb18c9 (diff) | |
download | chat-b813234f4cc38e72bb94556d3a4acdcde5071468.tar.gz chat-b813234f4cc38e72bb94556d3a4acdcde5071468.tar.bz2 chat-b813234f4cc38e72bb94556d3a4acdcde5071468.zip |
Merge pull request #170 from mattermost/mm-1420
Fixes mm-1420 adding initial support for postgres
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.go | 24 |
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 +} |