mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-01 22:31:15 +00:00
91d37be1da
* github.com/Microsoft/go-winio * github.com/bradrydzewski/togo * github.com/containerd/containerd * github.com/docker/cli * github.com/docker/docker * github.com/docker/docker-credential-helpers * github.com/franela/goblin * github.com/google/go-github/v39 * github.com/joho/godotenv * github.com/lib/pq * github.com/moby/moby * github.com/prometheus/client_golang * github.com/tevino/abool * github.com/woodpecker-ci/togo * github.com/xanzy/go-gitlab * github.com/xeipuuv/gojsonschema * github.com/mattn/go-sqlite3
25 lines
556 B
Go
25 lines
556 B
Go
// Package pq is a pure Go Postgres driver for the database/sql package.
|
|
|
|
//go:build aix || darwin || dragonfly || freebsd || linux || nacl || netbsd || openbsd || plan9 || solaris || rumprun || illumos
|
|
// +build aix darwin dragonfly freebsd linux 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
|
|
}
|