mirror of
https://github.com/TwiN/gatus.git
synced 2025-01-25 07:19:08 +01:00
ed3683cb32
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>
26 lines
579 B
Go
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
|
|
}
|