2021-10-01 13:59:55 +00:00
|
|
|
//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
|
2018-09-26 17:33:37 +00:00
|
|
|
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
|
|
|
|
|
|
|
|
package utils
|
|
|
|
|
|
|
|
import (
|
2018-11-07 19:53:11 +00:00
|
|
|
"golang.org/x/sys/unix"
|
2018-09-26 17:33:37 +00:00
|
|
|
)
|
|
|
|
|
2018-11-07 19:53:11 +00:00
|
|
|
// IsUnixRoot returns true if system is unix and user running is effectively root
|
|
|
|
func IsUnixRoot() bool {
|
|
|
|
return unix.Geteuid() == 0
|
|
|
|
}
|