Skip to content

Commit

Permalink
clear code
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzk1 committed Sep 3, 2024
1 parent 91e233e commit 2cda24b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions cmd/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"fmt"
"os"
"os/signal"
"os/user"
"runtime"
"strconv"
"strings"
Expand Down Expand Up @@ -48,12 +47,8 @@ func Main() {
})

// Process on macOS must run using sudo
if runtime.GOOS == "darwin" {
currentUser, _ := user.Current()
if currentUser.Uid != "0" {
fmt.Println("Please run this again with `sudo`.")
os.Exit(1)
}
if runtime.GOOS == "darwin" && syscall.Geteuid() != 0 {
klog.Warning("Please run this again with `sudo`.")
}

// trap Ctrl+C and call cancel on the context
Expand Down

0 comments on commit 2cda24b

Please sign in to comment.