github.com/ferranbt/nomad@v0.9.3-0.20190607002617-85c449b7667c/plugins/drivers/utils/utils_unix.go (about)

     1  // +build darwin dragonfly freebsd linux netbsd openbsd solaris
     2  
     3  package utils
     4  
     5  import (
     6  	"golang.org/x/sys/unix"
     7  )
     8  
     9  // IsUnixRoot returns true if system is unix and user running is effectively root
    10  func IsUnixRoot() bool {
    11  	return unix.Geteuid() == 0
    12  }