github.com/manicqin/nomad@v0.9.5/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  }