Files
.examples
.github
alerting
client
config
controller
core
docs
jsonpath
metrics
pattern
security
storage
test
util
vendor
github.com
TwiN
beorn7
cespare
coreos
davecgh
go-ping
golang
google
gorilla
ishidawataru
kballard
lib
pq
oid
scram
.gitignore
LICENSE.md
README.md
TESTS.md
array.go
buf.go
conn.go
conn_go18.go
connector.go
copy.go
doc.go
encode.go
error.go
krb.go
notice.go
notify.go
rows.go
ssl.go
ssl_permissions.go
ssl_windows.go
url.go
user_other.go
user_posix.go
user_windows.go
uuid.go
mattn
matttproud
miekg
prometheus
remyoudompheng
wcharczuk
golang.org
google.golang.org
gopkg.in
lukechampine.com
modernc.org
modules.txt
watchdog
web
.dockerignore
.gitattributes
.gitignore
Dockerfile
LICENSE
Makefile
README.md
config.yaml
go.mod
go.sum
main.go
gatus/vendor/github.com/lib/pq/user_posix.go
dependabot[bot] ed3683cb32 chore(deps): bump github.com/lib/pq from 1.10.3 to 1.10.7
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.10.3 to 1.10.7.
- [Release notes](https://github.com/lib/pq/releases)
- [Commits](https://github.com/lib/pq/compare/v1.10.3...v1.10.7)

---
updated-dependencies:
- dependency-name: github.com/lib/pq
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-02 19:40:52 -04:00

26 lines
579 B
Go

// Package pq is a pure Go Postgres driver for the database/sql package.
//go:build aix || darwin || dragonfly || freebsd || (linux && !android) || nacl || netbsd || openbsd || plan9 || solaris || rumprun || illumos
// +build aix darwin dragonfly freebsd linux,!android nacl netbsd openbsd plan9 solaris rumprun illumos
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
}