github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/plugins/drivers/utils/utils_unix.go (about) 1 //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris 2 // +build darwin dragonfly freebsd linux netbsd openbsd solaris 3 4 package utils 5 6 import ( 7 "golang.org/x/sys/unix" 8 ) 9 10 // IsUnixRoot returns true if system is unix and user running is effectively root 11 func IsUnixRoot() bool { 12 return unix.Geteuid() == 0 13 }