hostSync/utils/utils_unix.go

13 lines
263 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//go:build !windows
// +build !windows
package utils
import "os"
// isRunningAsAdmin 检查当前进程是否以管理员权限运行 (Unix/Linux/macOS)
func isRunningAsAdmin() bool {
// 在Unix系统中检查是否为root用户
return os.Getuid() == 0
}