From 4f9c31f827b704e61bcc77a24b5d38c1a813285d Mon Sep 17 00:00:00 2001 From: Leonardo Taccari Date: Sun, 26 Feb 2023 17:13:52 +0100 Subject: [PATCH] Merge permission_darwin.go in permission_other.go Except the buildconstraint the implementation is completely the same. NFCI. --- permission/permission_darwin.go | 17 ----------------- permission/permission_other.go | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 permission/permission_darwin.go diff --git a/permission/permission_darwin.go b/permission/permission_darwin.go deleted file mode 100644 index 2e08d00..0000000 --- a/permission/permission_darwin.go +++ /dev/null @@ -1,17 +0,0 @@ -//go:build darwin - -package permissionutil - -import ( - "os" -) - -// checkCurrentUserRoot checks if the current user is root -func checkCurrentUserRoot() (bool, error) { - return os.Geteuid() == 0, nil -} - -// checkCurrentUserCapNetRaw checks if the current user has the CAP_NET_RAW capability -func checkCurrentUserCapNetRaw() (bool, error) { - return false, ErrNotImplemented -} diff --git a/permission/permission_other.go b/permission/permission_other.go index 76f4835..9d00864 100644 --- a/permission/permission_other.go +++ b/permission/permission_other.go @@ -1,4 +1,4 @@ -//go:build freebsd || netbsd || openbsd || solaris || android || ios +//go:build darwin || freebsd || netbsd || openbsd || solaris || android || ios package permissionutil