Move checkRoot to main

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
Dimitris Karakasilis
2023-09-14 15:53:27 +03:00
parent fddbf3f657
commit bf40c48812
6 changed files with 29 additions and 36 deletions

View File

@@ -1,7 +1,6 @@
package agent
import (
"errors"
"fmt"
"os"
"path/filepath"
@@ -96,11 +95,3 @@ func Run(opts ...Option) error {
}
return err
}
func checkRoot() error {
if os.Geteuid() != 0 {
return errors.New("this command requires root privileges")
}
return nil
}