serviceman/installer/whoami.go

16 lines
209 B
Go
Raw Normal View History

2019-07-01 08:44:48 +00:00
// +build !windows
package installer
import "os/user"
func isPrivileged() bool {
u, err := user.Current()
if nil != err {
return false
}
// not quite, but close enough for now
return "0" == u.Uid
}